lion/packages/core/test/lit-html.test.js
Thomas Allmer ec8da8f12c feat: release inital public lion version
Co-authored-by: Mikhail Bashkirov <mikhail.bashkirov@ing.com>
Co-authored-by: Thijs Louisse <thijs.louisse@ing.com>
Co-authored-by: Joren Broekema <joren.broekema@ing.com>
Co-authored-by: Gerjan van Geest <gerjan.van.geest@ing.com>
Co-authored-by: Erik Kroes <erik.kroes@ing.com>
Co-authored-by: Lars den Bakker <lars.den.bakker@ing.com>
2019-04-26 10:37:57 +02:00

26 lines
849 B
JavaScript

/* eslint-env mocha */
import { expect, fixture } from '@open-wc/testing';
import { html } from '../src/lit-html.js';
describe('lit-html', () => {
it('binds values when parent has shadow root', async () => {
class ComponentWithShadowDom extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
}
customElements.define('component-with-shadow-dom', ComponentWithShadowDom);
const myNumber = 10;
const myFunction = () => {};
const element = await fixture(html`
<component-with-shadow-dom>
<any-element .propNumber=${myNumber} .propFunction=${myFunction}></any-element>
</component-with-shadow-dom>
`);
expect(element.children[0].propNumber).to.equal(myNumber);
expect(element.children[0].propFunction).to.equal(myFunction);
});
});