22 lines
917 B
JavaScript
22 lines
917 B
JavaScript
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();
|
|
},
|
|
};
|