-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathElement.test.js
More file actions
35 lines (29 loc) · 1.07 KB
/
Element.test.js
File metadata and controls
35 lines (29 loc) · 1.07 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
beforeAll(async () => {
await page.goto('http://localhost:6969/element')
})
describe('Element', () => {
test('elements can receive any tag b', async () => {
const element = await page.$('b[data-tag="b"]')
expect(element).toBeTruthy()
})
test('elements can receive any tag abbr', async () => {
const element = await page.$('abbr[data-tag="abbr"]')
expect(element).toBeTruthy()
})
test('elements without tag become fragments', async () => {
const element = await page.$('[data-tag="fragment"]')
expect(element).toBeFalsy()
})
test('elements can be inner components and receive props', async () => {
const element = await page.$('[data-inner-component]')
expect(element).toBeTruthy()
})
test('elements can be class components and receive props', async () => {
const element = await page.$('[data-class-component]')
expect(element).toBeTruthy()
})
test('elements can be functional components and receive props', async () => {
const element = await page.$('[data-functional-component]')
expect(element).toBeTruthy()
})
})