Skip to content

Commit

Permalink
Update stories to make the visual changes easier to see
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Apr 20, 2023
1 parent d6afa96 commit d87b4e3
Show file tree
Hide file tree
Showing 39 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/VHeader/meta/VFilterButton.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ import { IMAGE } from "~/constants/media"
}}
/>

[//]:
#
"Flexible-width wrappers are added to the template to make the button
better visible on a darker background and to make the changes in button width
easier to see."

export const Template = (args, { argTypes }) => ({
template: `<div id="wrapper" class="w-40 h-16 bg-dark-charcoal-06 flex align-center justify-center">
template: `<div class="flex"><div id="wrapper" class="px-4 h-16 bg-dark-charcoal-06 flex align-center justify-center">
<VFilterButton v-bind="args" v-on="args" />
</div>`,
</div></div>`,
components: { VFilterButton },
props: Object.keys(argTypes),
setup() {
Expand Down
14 changes: 14 additions & 0 deletions frontend/test/storybook/visual-regression/v-filter-button.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ test.describe("VFilterButton", () => {
)
})

/**
* When focused and not pressed, the button is the same with and without hover,
* so we reuse the snapshot from the focused test.
*/
test(`focused, hovered, ${filterCount} filters`, async ({ page }) => {
await gotoWithArgs(page, { appliedFilters: filterCount })
await page.locator("button", { hasText: "Filter" }).focus()
await page.locator("button", { hasText: "Filter" }).hover()
await expectSnapshot(
`filter-button-focused-${filterCount}-checked`,
page.locator(wrapper)
)
})

test(`pressed, ${filterCount} filters`, async ({ page }) => {
await gotoWithArgs(page, {
appliedFilters: filterCount,
Expand Down
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.
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 d87b4e3

Please sign in to comment.