-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstateless.spec.ts
53 lines (41 loc) · 1.16 KB
/
stateless.spec.ts
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
import { CLASS_SELECTORS } from './cons';
import { focused } from './utils';
import { hasNoItems, hasClass } from './expects';
describe('Index', () => {
describe('stateless', () => {
beforeEach(async () => {
await page.goto('http://todomvc.com/examples/react/', { waitUntil: 'networkidle2' });
await page.waitFor(CLASS_SELECTORS.NEW_TODO);
},
// 1000 * 10
)
describe(
'When page is initially opened',
function () {
it(
'should focus on the todo input field',
async function () {
await focused()
.then(hasClass(CLASS_SELECTORS.NEW_TODO))
}
)
})
describe('No Todos', function () {
it(
'starts with nothing',
async () => {
await hasNoItems()
}
)
it(
'should hide #main and #footer',
async function () {
await expect(page).not.toMatchElement(CLASS_SELECTORS.TODO_ITEMS);
await expect(page).not.toMatchElement(CLASS_SELECTORS.MAIN);
await expect(page).not.toMatchElement(CLASS_SELECTORS.FOOTER);
},
// 1000 * 10
)
})
})
})