-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathChildComponent.test.js
More file actions
67 lines (56 loc) · 2.44 KB
/
ChildComponent.test.js
File metadata and controls
67 lines (56 loc) · 2.44 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
beforeAll(async () => {
await page.goto('http://localhost:6969/child-component')
})
describe('ChildComponent', () => {
test('Nullstack is auto imported when using inheritance', async () => {
const element = await page.$('[data-current="ChildComponent"]')
expect(element).toBeTruthy()
})
test('inner components are overridable', async () => {
const element = await page.$('[data-current]')
expect(element).toBeTruthy()
})
test('server functions are bound to the class in ssr', async () => {
const element = await page.$('[data-child-this]')
expect(element).toBeTruthy()
})
test('inherited server functions are bound to the class ssr', async () => {
const element = await page.$('[data-parent-this]')
expect(element).toBeTruthy()
})
test('server functions are bound to the class in spa', async () => {
await page.waitForSelector('[data-hydrated-child-this]')
const element = await page.$('[data-hydrated-child-this]')
expect(element).toBeTruthy()
})
test('inherited server functions are bound to the class spa', async () => {
await page.waitForSelector('[data-hydrated-parent-this]')
const element = await page.$('[data-hydrated-parent-this]')
expect(element).toBeTruthy()
})
test('static inherited server functions are bound to the original class spa', async () => {
await page.waitForSelector('[data-static-hydrated-parent-this]')
const element = await page.$('[data-static-hydrated-parent-this]')
expect(element).toBeTruthy()
})
test('static inherited server functions are bound to the original class ssr', async () => {
await page.waitForSelector('[data-static-parent-this]')
const element = await page.$('[data-static-parent-this]')
expect(element).toBeTruthy()
})
test('static server functions are bound to the class in spa', async () => {
await page.waitForSelector('[data-static-hydrated-child-this]')
const element = await page.$('[data-static-hydrated-child-this]')
expect(element).toBeTruthy()
})
test('static server functions are bound to the class in srs', async () => {
await page.waitForSelector('[data-static-child-this]')
const element = await page.$('[data-static-child-this]')
expect(element).toBeTruthy()
})
test('Nullstack is injected in tsx files', async () => {
await page.waitForSelector('[data-static-child-this]')
const element = await page.$('[data-static-child-this]')
expect(element).toBeTruthy()
})
})