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:
@@ -1,4 +1,11 @@
|
||||
import { setup } from '@storybook/vue3';
|
||||
|
||||
import '../src/assets/styles/global.scss';
|
||||
import { storybookRouter } from './router.js';
|
||||
|
||||
setup((app) => {
|
||||
app.use(storybookRouter);
|
||||
});
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { createMemoryHistory, createRouter } from 'vue-router';
|
||||
|
||||
const stub = { render: () => null };
|
||||
|
||||
// Mirrors the named routes in src/router/index.js so RouterLink resolution
|
||||
// works in isolated stories without importing the real app router/guards.
|
||||
export const storybookRouter = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [
|
||||
{ path: '/', name: 'catalog', component: stub },
|
||||
{ path: '/listings/:id', name: 'listing-detail', component: stub },
|
||||
{ path: '/products/:slug', name: 'product-detail', component: stub },
|
||||
{ path: '/login', name: 'login', component: stub },
|
||||
{ path: '/admin', name: 'admin-home', component: stub },
|
||||
{ path: '/admin/inventory/:id/images', name: 'admin-image-manager', component: stub },
|
||||
{ path: '/admin/inventory', name: 'admin-inventory', component: stub },
|
||||
{ path: '/admin/listings', name: 'admin-listings', component: stub },
|
||||
{ path: '/admin/sales', name: 'admin-sales', component: stub },
|
||||
{ path: '/admin/acquisitions', name: 'admin-acquisitions', component: stub },
|
||||
{ path: '/admin/settings', name: 'admin-settings', component: stub },
|
||||
{ path: '/admin/saved-views', name: 'admin-saved-views', component: stub },
|
||||
{ path: '/:pathMatch(.*)*', name: 'storybook-catch-all', component: stub },
|
||||
],
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
// Forces a narrow viewport for stories that specifically exercise mobile-only
|
||||
// CSS breakpoints, since @storybook/addon-viewport does not affect the
|
||||
// headless iframe size that @storybook/test-runner navigates to directly.
|
||||
export default {
|
||||
async preVisit(page, context) {
|
||||
if (context.id?.startsWith('pages-catalogpage--mobile')) {
|
||||
await page.setViewportSize({ width: 375, height: 900 });
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user