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:
@@ -34,7 +34,7 @@ h1 { max-width: 760px; margin: var(--space-3) 0 var(--space-4); font-size: var(-
|
||||
.product-facts dt { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.1em; text-transform: uppercase; }
|
||||
.product-facts dd { margin: 0; }
|
||||
.catalog-state { padding: var(--space-12) 0; color: var(--color-text-muted); }
|
||||
.catalog-state--error { color: var(--color-danger-500); }
|
||||
.catalog-state--error { color: var(--color-danger-text); }
|
||||
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-6); margin-top: var(--space-8); color: var(--color-text-muted); font-size: var(--text-sm); }
|
||||
.pagination button { min-width: 44px; min-height: 44px; border: var(--border-thin) solid var(--color-border-strong); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); background: var(--color-surface); color: var(--color-interactive); }
|
||||
.pagination button:disabled { cursor: not-allowed; opacity: 0.45; }
|
||||
|
||||
@@ -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