-
-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathdataResearch.spec.ts
More file actions
49 lines (43 loc) · 2.02 KB
/
Copy pathdataResearch.spec.ts
File metadata and controls
49 lines (43 loc) · 2.02 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
import { expect, setupTest, test } from './utils'
test.describe('Data Research Page Tests', () => {
test.beforeEach(async ({ page }) => {
await setupTest(page)
})
test('accessing /data-research directly works', async ({ page }) => {
await page.goto('/data-research')
await page.locator('.preloader').waitFor({ state: 'hidden' })
await page.waitForLoadState('networkidle')
await expect(page).toHaveURL(/data-research/)
})
test('page displays research section heading', async ({ page }) => {
await page.goto('/data-research')
await page.locator('.preloader').waitFor({ state: 'hidden' })
await page.waitForLoadState('networkidle')
const title = page.locator('h2', { hasText: 'מחקרים' })
await expect(title).toBeVisible()
})
test('page displays research description text', async ({ page }) => {
await page.goto('/data-research')
await page.locator('.preloader').waitFor({ state: 'hidden' })
await page.waitForLoadState('networkidle')
await expect(
page.getByText('אם יש לכם רעיון מעניין למה קורים פה דברים, דברו איתנו בסלאק!'),
).toBeVisible()
})
test('stacked research section with charts is rendered', async ({ page }) => {
await page.goto('/data-research')
await page.locator('.preloader').waitFor({ state: 'hidden' })
await page.waitForLoadState('networkidle')
const etlWidget = page.locator('h2', { hasText: 'בעיות etl/gps/משהו גלובאלי אחר' })
await expect(etlWidget).toBeVisible()
})
test('research page has date selectors and operator selector', async ({ page }) => {
await page.goto('/data-research')
await page.locator('.preloader').waitFor({ state: 'hidden' })
await page.waitForLoadState('networkidle')
const startDateGroup = page.getByRole('group', { name: 'התחלה' }).first()
const endDateGroup = page.getByRole('group', { name: 'סיום' }).first()
await expect(startDateGroup).toBeVisible()
await expect(endDateGroup).toBeVisible()
})
})