This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
import { expect, within } from '@storybook/test';
|
||||
import ProductDetailPage from './ProductDetailPage.vue';
|
||||
|
||||
export default { title: 'Pages/ProductDetailPage', component: ProductDetailPage };
|
||||
|
||||
export const Overview = {};
|
||||
|
||||
export const PublicSellerDescription = {
|
||||
beforeEach: () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async () => new Response(JSON.stringify({ data: {
|
||||
id: 'listing-1', name: 'Pikachu', productName: 'Pikachu', status: 'AVAILABLE',
|
||||
askingPriceMinor: 2500, sellerDisplayName: 'Pika Collectibles',
|
||||
sellerDescription: 'Independent Pokémon collector.', images: [], tags: [],
|
||||
} }), { headers: { 'content-type': 'application/json' } });
|
||||
return () => { globalThis.fetch = originalFetch; };
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
await expect(await within(canvasElement).findByText('Independent Pokémon collector.')).toBeVisible();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user