-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathFalsyNodes.test.js
More file actions
30 lines (25 loc) · 1.08 KB
/
FalsyNodes.test.js
File metadata and controls
30 lines (25 loc) · 1.08 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
beforeAll(async () => {
await page.goto('http://localhost:6969/falsy-nodes')
})
describe('Falsy Nodes', () => {
test('Null nodes should render a comment', async () => {
const truth = await page.$eval('[data-null]', (e) => e.childNodes[0] instanceof Comment)
expect(truth).toBeTruthy()
})
test('False nodes should render a comment', async () => {
const truth = await page.$eval('[data-false]', (e) => e.childNodes[0] instanceof Comment)
expect(truth).toBeTruthy()
})
test('Components returning null should render a comment', async () => {
const truth = await page.$eval('[data-null-component]', (e) => e.childNodes[0] instanceof Comment)
expect(truth).toBeTruthy()
})
test('Components returning false should render a comment', async () => {
const truth = await page.$eval('[data-false-component]', (e) => e.childNodes[0] instanceof Comment)
expect(truth).toBeTruthy()
})
test('Zero nodes should render a text node', async () => {
const truth = await page.$eval('[data-zero]', (e) => e.textContent === '0')
expect(truth).toBeTruthy()
})
})