-
-
Notifications
You must be signed in to change notification settings - Fork 835
Expand file tree
/
Copy pathscoped-basic.test.tsx
More file actions
51 lines (41 loc) · 1.83 KB
/
scoped-basic.test.tsx
File metadata and controls
51 lines (41 loc) · 1.83 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// <reference types="webdriverio" />
import { h } from '@stencil/core';
import { render } from '@wdio/browser-runner/stencil';
import { $, expect } from '@wdio/globals';
describe('scoped-basic', function () {
beforeEach(() => {
render({
components: [],
template: () => <scoped-basic-root colormode="md"></scoped-basic-root>,
});
});
it('render', async () => {
const doc = await $('scoped-basic-root');
await doc.waitForStable();
await expect(doc).toHaveElementClass(expect.stringContaining('sc-scoped-basic-root-md-h'));
await expect(doc).toHaveElementClass(expect.stringContaining('hydrated'));
const scopedEl = await $('scoped-basic');
await scopedEl.waitForStable();
await expect(scopedEl).toHaveElementClass(expect.stringContaining('sc-scoped-basic-root-md'));
await expect(scopedEl).toHaveElementClass(expect.stringContaining('sc-scoped-basic-h'));
await expect(scopedEl).toHaveElementClass(expect.stringContaining('hydrated'));
await expect(scopedEl).toHaveStyle({
backgroundColor: 'rgb(0,0,0)',
color: 'rgb(128,128,128)',
});
const scopedDiv = await $('scoped-basic span');
await expect(scopedDiv).toHaveElementClass(expect.stringContaining('sc-scoped-basic'));
await expect(scopedDiv).toHaveStyle({
color: 'rgb(255,0,0)',
});
const scopedP = await $('scoped-basic p');
await expect(scopedP).toHaveElementClass(expect.stringContaining('sc-scoped-basic'));
await expect(scopedP).toHaveElementClass(expect.stringContaining('sc-scoped-basic-s'));
const scopedSlot = await $('scoped-basic p span');
await expect(scopedSlot).toHaveElementClass(expect.stringContaining('sc-scoped-basic-root-md'));
await expect(scopedSlot).toHaveText('light');
await expect(scopedSlot).toHaveStyle({
color: 'rgb(255,255,0)',
});
});
});