Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound committed May 28, 2024
1 parent bbedbed commit 6ac04e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/test/playwright/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ export const searchTypeNames = {
*/
export const openContentSettingsTab = async (
page: Page,
tab: "searchTypes" | "filters" = "searchTypes",
dir: LanguageDirection = "ltr"
tab: "searchTypes" | "filters" = "searchTypes"
) => {
const tabKey = tab === "searchTypes" ? "searchType.heading" : "filters.title"
const tabId = tab === "searchTypes" ? "content-settings" : "filters"

await page.getByRole("tab", { name: t(tabKey, dir) }).click()
await page.locator(`#tab-${tabId}`).click()
}

/**
Expand Down Expand Up @@ -105,7 +104,7 @@ export const setContentSwitcherState = async (
await buttonLocator.isEnabled()
await buttonLocator.click()
}
return openContentSettingsTab(page, contentSwitcherKind, dir)
return openContentSettingsTab(page, contentSwitcherKind)
} else if (isPressed) {
await closeContentSettingsModal(page, dir)
}
Expand Down

0 comments on commit 6ac04e0

Please sign in to comment.