Skip to content

Commit

Permalink
test: remove redundant API request in dashboard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fityannugroho committed Nov 12, 2024
1 parent a7e90a1 commit 83bcfff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/__tests__/dashboard/area-selector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { config } from '@/lib/config'
import { expect, test } from '@playwright/test'

test.beforeEach(async ({ page }) => {
const res = await page.request.get(config.dataSource.area.url)
await expect(res).toBeOK()

await page.goto('/')
})

Expand Down
3 changes: 0 additions & 3 deletions app/__tests__/dashboard/boundary-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { config } from '@/lib/config'
import test, { expect } from '@playwright/test'

test.beforeEach(async ({ page }) => {
const res = await page.request.get(config.dataSource.area.url)
await expect(res).toBeOK()

await page.goto('/')
})

Expand Down
6 changes: 4 additions & 2 deletions app/__tests__/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { config } from '@/lib/config'
import { expect, test } from '@playwright/test'

test.beforeEach(async ({ page }) => {
await page.goto('/')
})

test.describe('meta tags', () => {
test('has title', async ({ page }) => {
await page.goto('/')
await expect(page).toHaveTitle(config.appName)
})

test('has description', async ({ page }) => {
await page.goto('/')
await expect(
page.locator('head').locator('meta[name="description"]'),
).toHaveAttribute('content', config.appDescription)
Expand Down

0 comments on commit 83bcfff

Please sign in to comment.