-
Notifications
You must be signed in to change notification settings - Fork 501
/
Copy pathnavigation.test.js
47 lines (41 loc) · 1.47 KB
/
navigation.test.js
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
import { test, expect } from './setup/coverage.js'
test.describe('Navigation menu', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/#/blank')
})
test('should work for Status page', async ({ page }) => {
const link = 'a[href="#/"]'
await page.waitForSelector(link)
await page.waitForSelector('text=Status')
await page.click(link)
await expect(page).toHaveTitle('Status | IPFS')
})
test('should work for Files page', async ({ page }) => {
const link = 'a[href="#/files"]'
await page.waitForSelector(link)
await page.waitForSelector('text=Files')
await page.click(link)
await expect(page).toHaveTitle('/ | Files | IPFS')
})
test('should work for Explore page', async ({ page }) => {
const link = 'a[href="#/explore"]'
await page.waitForSelector(link)
await page.waitForSelector('text=Explore')
await page.click(link)
await expect(page).toHaveTitle('Explore | IPLD')
})
test('should work for Peers page', async ({ page }) => {
const link = 'a[href="#/peers"]'
await page.waitForSelector(link)
await page.waitForSelector('text=Peers')
await page.click(link)
await expect(page).toHaveTitle('Peers | IPFS')
})
test('should work for Settings page', async ({ page }) => {
const link = 'a[href="#/settings"]'
await page.waitForSelector(link)
await page.waitForSelector('text=Settings')
await page.click(link)
await expect(page).toHaveTitle('Settings | IPFS')
})
})