-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathContext.test.js
More file actions
66 lines (55 loc) · 2.66 KB
/
Context.test.js
File metadata and controls
66 lines (55 loc) · 2.66 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
beforeAll(async () => {
await page.goto('http://localhost:6969/context')
})
describe('Context', () => {
test('setting a key to the server context makes it permanent', async () => {
const element = await page.$('[data-framework="Nullstack"]')
expect(element).toBeTruthy()
})
test('keys of the server context are available to all server functions', async () => {
const element = await page.$('[data-framework="Nullstack"]')
expect(element).toBeTruthy()
})
test('setting a key to the client context makes it permanent', async () => {
const element = await page.$('[data-framework="Nullstack"]')
expect(element).toBeTruthy()
})
test('keys of the client context are available to all client functions', async () => {
const element = await page.$('[data-framework="Nullstack"]')
expect(element).toBeTruthy()
})
test('the client context is merged into all instance methods', async () => {
const element = await page.$('[data-framework-initial="N"]')
expect(element).toBeTruthy()
})
test('hydrated static async underline function has no context', async () => {
await page.waitForSelector('[data-hydrated-static-async-underline-function-has-no-context]')
const element = await page.$('[data-hydrated-static-async-underline-function-has-no-context]')
expect(element).toBeTruthy()
})
test('hydrated static underline function has no context', async () => {
await page.waitForSelector('[data-hydrated-static-underline-function-has-no-context]')
const element = await page.$('[data-hydrated-static-underline-function-has-no-context]')
expect(element).toBeTruthy()
})
test('hydrated static function has no context', async () => {
await page.waitForSelector('[data-hydrated-static-function-has-no-context]')
const element = await page.$('[data-hydrated-static-function-has-no-context]')
expect(element).toBeTruthy()
})
test('static async underline function has no context', async () => {
await page.waitForSelector('[data-static-async-underline-function-has-no-context]')
const element = await page.$('[data-static-async-underline-function-has-no-context]')
expect(element).toBeTruthy()
})
test('static underline function has no context', async () => {
await page.waitForSelector('[data-static-underline-function-has-no-context]')
const element = await page.$('[data-static-underline-function-has-no-context]')
expect(element).toBeTruthy()
})
test('static function has no context', async () => {
await page.waitForSelector('[data-static-function-has-no-context]')
const element = await page.$('[data-static-function-has-no-context]')
expect(element).toBeTruthy()
})
})