-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix(engine): closes #871 - support for svg manual injection * fix(engine): integration tests
- Loading branch information
Showing
5 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
...t-lwc-dom-mode-manual-svg/integration/lwc-dom-mode-manual-svg/lwc-dom-mode-manual-svg.css
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 @@ | ||
:host { | ||
display: block; | ||
} |
3 changes: 3 additions & 0 deletions
3
...-lwc-dom-mode-manual-svg/integration/lwc-dom-mode-manual-svg/lwc-dom-mode-manual-svg.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,3 @@ | ||
<template> | ||
<svg lwc:dom="manual"></svg> | ||
</template> |
12 changes: 12 additions & 0 deletions
12
...st-lwc-dom-mode-manual-svg/integration/lwc-dom-mode-manual-svg/lwc-dom-mode-manual-svg.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,12 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class DomModeManualSvg extends LightningElement { | ||
rendered = false | ||
renderedCallback() { | ||
if (this.rendered === false) { | ||
this.rendered = true; | ||
const elm = document.createElement('g'); | ||
this.template.querySelector('svg').appendChild(elm); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ion-tests/src/components/dom/test-lwc-dom-mode-manual-svg/lwc-dom-mode-manual-svg.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,20 @@ | ||
const assert = require('assert'); | ||
describe('CSS token on manual svg dom node', () => { | ||
const URL = 'http://localhost:4567/lwc-dom-mode-manual-svg'; | ||
|
||
before(() => { | ||
browser.url(URL); | ||
}); | ||
|
||
it('should have token', () => { | ||
|
||
const elm = browser.execute(function () { | ||
return document.querySelector('integration-lwc-dom-mode-manual-svg').shadowRoot.querySelector('g'); | ||
}); | ||
|
||
browser.waitUntil(() => { | ||
return elm.getAttribute('integration-lwc-dom-mode-manual-svg_lwc-dom-mode-manual-svg') === ''; | ||
}, 500, '<g> should have css token'); | ||
|
||
}); | ||
}); |