-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-component.spec.ts
36 lines (34 loc) 路 1023 Bytes
/
my-component.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { newSpecPage } from '@stencil/core/testing';
import { MyComponent } from './my-component';
describe('my-component', () => {
it('renders', async () => {
const { root } = await newSpecPage({
components: [MyComponent],
html: '<my-component></my-component>',
});
expect(root).toEqualHtml(`
<my-component>
<mock:shadow-root>
<div>
Hello, World! I'm
</div>
</mock:shadow-root>
</my-component>
`);
});
it('renders with values', async () => {
const { root } = await newSpecPage({
components: [MyComponent],
html: `<my-component first="Stencil" last="'Don't call me a framework' JS"></my-component>`,
});
expect(root).toEqualHtml(`
<my-component first="Stencil" last="'Don't call me a framework' JS">
<mock:shadow-root>
<div>
Hello, World! I'm Stencil 'Don't call me a framework' JS
</div>
</mock:shadow-root>
</my-component>
`);
});
});