Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Feb 7, 2023
1 parent 19e2b16 commit fb04503
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 205 deletions.
198 changes: 0 additions & 198 deletions test/playwright/e2e/filters-old.spec.ts

This file was deleted.

17 changes: 10 additions & 7 deletions test/playwright/e2e/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const assertCheckboxCount = async (
}

const FILTER_COUNTS = {
[ALL_MEDIA]: 11,
[AUDIO]: 32,
[IMAGE]: 70,
[ALL_MEDIA]: 10,
[AUDIO]: 31,
[IMAGE]: 69,
}

breakpoints.describeMobileAndDesktop(() => {
Expand All @@ -65,7 +65,8 @@ breakpoints.describeMobileAndDesktop(() => {
"/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator"
)
await openFilters(page)
const expectedFilters = ["cc0", "commercial", "creator"]
// Creator filter was removed from the UI
const expectedFilters = ["cc0", "commercial"]

for (const checkbox of expectedFilters) {
await assertCheckboxStatus(page, checkbox)
Expand All @@ -79,7 +80,8 @@ breakpoints.describeMobileAndDesktop(() => {
"/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator"
)
await openFilters(page)
const expectedFilters = ["cc0", "commercial", "creator"]
// Creator filter was removed from the UI
const expectedFilters = ["cc0", "commercial"]

for (const checkbox of expectedFilters) {
await assertCheckboxStatus(page, checkbox)
Expand All @@ -103,14 +105,15 @@ breakpoints.describeMobileAndDesktop(() => {
)
await openFilters(page)

for (const checkbox of ["cc0", "commercial", "creator"]) {
// Creator filter was removed from the UI
for (const checkbox of ["cc0", "commercial"]) {
await assertCheckboxStatus(page, checkbox)
}

await changeContentType(page, "All content")

await openFilters(page)
await expect(page.locator('input[type="checkbox"]:checked')).toHaveCount(3)
await expect(page.locator('input[type="checkbox"]:checked')).toHaveCount(2)

await expect(page).toHaveURL(
"/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator"
Expand Down

0 comments on commit fb04503

Please sign in to comment.