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

Commit

Permalink
Update content switcher tabs fonts and icons to match the mockups (#2140
Browse files Browse the repository at this point in the history
)

* Add icon and change fonts for tabs

* Fix VR test

* Add snapshots
  • Loading branch information
obulat authored Feb 8, 2023
1 parent a49e0a3 commit df016dd
Show file tree
Hide file tree
Showing 30 changed files with 78 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
v-if="showFilters"
id="content-settings"
size="medium"
class="category me-4"
>{{ $t("search-type.heading") }}</VTab
class="gap-x-2 me-4"
><VIcon :icon-path="searchType.icon" />{{
$t("search-type.heading")
}}</VTab
>
<h2
v-else
Expand All @@ -30,9 +32,14 @@
<VIcon :icon-path="searchType.icon" />
{{ $t("search-type.heading") }}
</h2>
<VTab v-if="showFilters" id="filters" size="medium" class="category">{{
$t("filters.title")
}}</VTab>
<VTab
v-if="showFilters"
id="filters"
size="medium"
class="label-regular gap-x-2"
>
<VIcon :icon-path="filtersIcon" />{{ $t("filters.title") }}</VTab
>
<VIconButton
class="self-center ms-auto hover:bg-dark-charcoal hover:text-white"
:icon-props="{ iconPath: closeIcon }"
Expand Down Expand Up @@ -89,6 +96,7 @@ import VTabPanel from "~/components/VTabs/VTabPanel.vue"
import VTabs from "~/components/VTabs/VTabs.vue"
import closeIcon from "~/assets/icons/close-small.svg"
import filtersIcon from "~/assets/icons/filter.svg"
export default defineComponent({
name: "VContentSettingsModalContent",
Expand Down Expand Up @@ -161,6 +169,7 @@ export default defineComponent({
return {
closeIcon,
filtersIcon,
searchType,
selectedTab,
Expand Down
2 changes: 1 addition & 1 deletion src/components/VTabs/VTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default defineComponent({
@apply rounded-t-sm border-x border-t border-tx text-sm font-semibold md:text-base md:font-semibold md:leading-snug;
}
.plain {
@apply rounded-sm border-tx bg-tx text-sr font-semibold uppercase hover:bg-dark-charcoal-10;
@apply rounded-sm border-tx bg-tx text-sm hover:bg-dark-charcoal-10;
}
.bordered-selected {
@apply -mb-[1px] border border-x-dark-charcoal-20 border-t-dark-charcoal-20 border-b-white bg-white;
Expand Down
2 changes: 1 addition & 1 deletion src/locales/scripts/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@
video: "Videos",
"model-3d": "3D Models",
label: "Type of content to search",
heading: "Content types",
heading: "Content type",
additional: "Coming soon",
"status-beta": "Beta",
"see-image": "See all images",
Expand Down
2 changes: 1 addition & 1 deletion test/playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const config: PlaywrightTestConfig = {
*/
command: "./node_modules/.bin/npm-run-all -p -r talkback prod:playwright",
cwd: "/app",
timeout: 60_000 * 5, // 5 minutes
timeout: process.env.CI ? 60_000 * 5 : 60_000 * 10, // 5 minutes in CI, 10 in other envs
port: 8443,
reuseExistingServer: !process.env.CI || process.env.PWDEBUG === "1",
env: {
Expand Down
2 changes: 1 addition & 1 deletion test/playwright/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const openContentSettingsTab = async (
tab: "contentTypes" | "filters" = "contentTypes",
dir: LanguageDirection = "ltr"
) => {
const selector = buttonSelectors.mobileContentSettings
const selector = "#content-settings-button"

await ensureButtonPressed(page, selector)

Expand Down

This file was deleted.

Binary file not shown.
60 changes: 60 additions & 0 deletions test/playwright/visual-regression/components/filters.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { expect, test } from "@playwright/test"

import {
enableNewHeader,
goToSearchTerm,
languageDirections,
t,
} from "~~/test/playwright/utils/navigation"
import breakpoints from "~~/test/playwright/utils/breakpoints"

test.describe.configure({ mode: "parallel" })

for (const dir of languageDirections) {
breakpoints.describeEachDesktop(() => {
test(`Filters sidebar none selected - ${dir}`, async ({ page }) => {
await enableNewHeader(page)

await goToSearchTerm(page, "birds", { dir })

expect(await page.locator(".sidebar").screenshot()).toMatchSnapshot(
`filters-sidebar-${dir}.png`
)
})

test(`Filters sidebar some filters selected - ${dir}`, async ({ page }) => {
await enableNewHeader(page)

await goToSearchTerm(page, "birds", { dir })
await page.locator('input[type="checkbox"]').first().check()

expect(await page.locator(".sidebar").screenshot()).toMatchSnapshot(
`filters-sidebar-checked-${dir}.png`
)
})
})

breakpoints.describeEachMobile(({ expectSnapshot }) => {
test(`Filters modal none selected - ${dir}`, async ({ page }) => {
await enableNewHeader(page)

await goToSearchTerm(page, "birds", { dir })
await page.getByRole("button", { name: "Menu" }).click()
await page.getByRole("tab", { name: t("filters.title", dir) }).click()

await expectSnapshot(`filters-modal-${dir}.png`, page)
})

test(`Filters modal some filters selected - ${dir}`, async ({ page }) => {
await enableNewHeader(page)

await goToSearchTerm(page, "birds", { dir })
await page.getByRole("button", { name: "Menu" }).click()
await page.getByRole("tab", { name: t("filters.title", dir) }).click()

await page.locator('input[type="checkbox"]').first().check()

await expectSnapshot(`filters-modal-filters-selected-${dir}.png`, page)
})
})
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit df016dd

Please sign in to comment.