-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(template-compiler): styles containing newlines (#4580)
Fixes #4579
- Loading branch information
1 parent
bdde92f
commit e8098e1
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/@lwc/integration-karma/test/regression/style-newline/index.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createElement } from 'lwc'; | ||
import Component from 'x/component'; | ||
|
||
it('should render style containing newline - issue #4579', async () => { | ||
const elm = createElement('x-component', { is: Component }); | ||
document.body.appendChild(elm); | ||
|
||
await Promise.resolve(); | ||
|
||
const div = elm.shadowRoot.querySelector('div'); | ||
expect(div.style.color).toBe('yellow'); | ||
|
||
const span = elm.shadowRoot.querySelector('span'); | ||
expect(span.style.color).toBe('purple'); | ||
expect(span.style.backgroundColor).toBe('orange'); | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/@lwc/integration-karma/test/regression/style-newline/x/component/component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<div style="color: | ||
yellow"></div> | ||
|
||
<span style="color: | ||
purple; | ||
background-color: | ||
orange;"></span> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/integration-karma/test/regression/style-newline/x/component/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters