-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathPureComponents.test.js
More file actions
61 lines (52 loc) · 2 KB
/
PureComponents.test.js
File metadata and controls
61 lines (52 loc) · 2 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
beforeAll(async () => {
await page.goto('http://localhost:6969/pure-components?works=true')
})
describe('RemoveStart', () => {
test('anonymous functions can be components with context', async () => {
await page.waitForSelector('[data-anon]')
const element = await page.$('[data-anon]')
expect(element).toBeTruthy()
})
test('anonymous functions can be components with attributes', async () => {
await page.waitForSelector('#anon')
const element = await page.$('#anon')
expect(element).toBeTruthy()
})
test('named functions can be components with context', async () => {
await page.waitForSelector('[data-named]')
const element = await page.$('[data-named]')
expect(element).toBeTruthy()
})
test('named functions can be components with attributes', async () => {
await page.waitForSelector('#named')
const element = await page.$('#named')
expect(element).toBeTruthy()
})
test('arrow functions can be components with context', async () => {
await page.waitForSelector('[data-arrow]')
const element = await page.$('[data-arrow]')
expect(element).toBeTruthy()
})
test('arrow functions can be components with attributes', async () => {
await page.waitForSelector('#arrow')
const element = await page.$('#arrow')
expect(element).toBeTruthy()
})
test('inner functions can be components with context', async () => {
await page.waitForSelector('[data-inner]')
const element = await page.$('[data-inner]')
expect(element).toBeTruthy()
})
test('inner functions can be components with attributes', async () => {
await page.waitForSelector('#inner')
const element = await page.$('#inner')
expect(element).toBeTruthy()
})
test('pure components receive a proxy to the context', async () => {
await page.focus('input')
await page.keyboard.type('!')
await page.waitForSelector('[data-string="!nullstack"]')
const element = await page.$('[data-string="!nullstack"]')
expect(element).toBeTruthy()
})
})