-
-
Notifications
You must be signed in to change notification settings - Fork 835
Expand file tree
/
Copy pathslotted-css.test.tsx
More file actions
37 lines (32 loc) · 1.14 KB
/
slotted-css.test.tsx
File metadata and controls
37 lines (32 loc) · 1.14 KB
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
37
import { h } from '@stencil/core';
import { render } from '@wdio/browser-runner/stencil';
describe('slotted css', function () {
beforeEach(async () => {
render({
template: () => (
<slotted-css>
<div class="red" slot="header-slot-name">
header-slot-name: red color and border
</div>
<div class="green">default slot: green background, blue border and color</div>
<div class="blue" slot="footer-slot-name">
footer-slot-name: blue color and border
</div>
</slotted-css>
),
});
await $('slotted-css').waitForExist();
});
it('assign slotted css', async () => {
const redElm = $('slotted-css .red');
await expect(redElm).toHaveStyle({ color: 'rgb(255,0,0)' });
// green background, blue border and color
const greenElm = $('slotted-css .green');
await expect(greenElm).toHaveStyle({
background: `none 0% 0% auto repeat padding-box border-box scroll rgb(0, 255, 0)`,
color: 'rgb(0,0,255)',
});
const blueElm = $('slotted-css .blue');
await expect(blueElm).toHaveStyle({ color: 'rgb(0,0,255)' });
});
});