Skip to content

Commit

Permalink
Merge pull request #1105 from kitimark/fix-media-query-style-loss-test
Browse files Browse the repository at this point in the history
test: fix media query style is lost when it's compiled
  • Loading branch information
juandav authored Feb 13, 2024
2 parents 5d90fc8 + 4f79d29 commit 13ed63d
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ you can find all the documentation [here](https://nest-modules.github.io/mailer/
* [Juan Echeverry](https://github.com/juandav)
* [Pat McGowan](https://github.com/p-mcgowan)
* [Paweł Partyka](https://github.com/partyka95)
* [Wasutan Kitijerapat](https://github.com/kitimark)

### License

Expand Down
2 changes: 1 addition & 1 deletion lib/mailer.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ describe('MailerService', () => {
'@media only screen and (max-width:350px)',
);
expect(lastMail.data.html?.toString().replace(/\n/g, '')).toContain(
`<html><head><style type=\"text/css\">@media only screen and (max-width:350px) { p { font-size: 20px; }}</style></head><body><p>Handlebars test template. by Nest-modules TM</p></body></html>`.replace(/\n/g, ''),
`<html><head><style data-css-inline=\"keep\" type=\"text/css\"> @media only screen and (max-width:350px) { p { font-size: 20px; } }</style></head><body><p>Handlebars test template. by Nest-modules TM</p></body></html>`
);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/test-templates/handlebars-template-media-query.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style type='text/css'>
<style data-css-inline="keep" type='text/css'>
@media only screen and (max-width:350px) { p { font-size: 20px; } }
</style>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
]
},
"dependencies": {
"@css-inline/css-inline": "0.12.1",
"@css-inline/css-inline": "0.13.0",
"glob": "10.3.10",
"mjml": "4.14.1",
"preview-email": "3.0.19"
Expand Down
100 changes: 93 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13ed63d

Please sign in to comment.