fix: correct catalog error contrast and add catalog Storybook coverage
Quality / test (push) Canceled after 0s
Quality / test (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { expect, userEvent, within } from '@storybook/test';
|
||||
|
||||
import CatalogPage from './CatalogPage.vue';
|
||||
|
||||
export default {
|
||||
title: 'Pages/CatalogPage',
|
||||
component: CatalogPage,
|
||||
};
|
||||
|
||||
export const Overview = {};
|
||||
|
||||
export const MobileFilterDisclosure = {
|
||||
parameters: {
|
||||
docs: {
|
||||
description: {
|
||||
story:
|
||||
'On narrow viewports, catalog filters collapse behind a keyboard-operable disclosure that hides filter controls from the accessibility tree until expanded.',
|
||||
},
|
||||
},
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
const toggle = canvas.getByRole('button', { name: /Filters/ });
|
||||
const setFilter = canvas.getByPlaceholderText('SV151');
|
||||
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'false');
|
||||
await expect(setFilter).not.toBeVisible();
|
||||
|
||||
await userEvent.click(toggle);
|
||||
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'true');
|
||||
await expect(setFilter).toBeVisible();
|
||||
|
||||
await userEvent.click(toggle);
|
||||
|
||||
await expect(toggle).toHaveAttribute('aria-expanded', 'false');
|
||||
await expect(setFilter).not.toBeVisible();
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user