docs/_snippets/mount-basic.md
import MockDate from 'mockdate';
// ...rest of story file
export const ChristmasUI = {
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
};
import MockDate from 'mockdate';
// ...rest of story file
export const ChristmasUI: Story = {
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
};
import MockDate from 'mockdate';
import preview from '../.storybook/preview';
import Page from './page.component';
const meta = preview.meta({
component: Page,
});
export const ChristmasUI = meta.story({
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
});
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Page from './Page.svelte';
const { Story } = defineMeta({
component: Page,
});
</script>
<Story
name="ChristmasUI"
play={async ({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
}}
/>
import MockDate from 'mockdate';
// ...rest of story file
export const ChristmasUI: Story = {
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Page from './Page.svelte';
const { Story } = defineMeta({
component: Page,
});
</script>
<Story
name="ChristmasUI"
play={async ({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
}}
/>
import MockDate from 'mockdate';
// ...rest of story file
export const ChristmasUI = {
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
};
import MockDate from 'mockdate';
import preview from '../.storybook/preview';
import Page from './Page';
const meta = preview.meta({
component: Page,
});
export const ChristmasUI = meta.story({
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
});
import MockDate from 'mockdate';
import preview from '../.storybook/preview';
import Page from './Page';
const meta = preview.meta({
component: Page,
});
export const ChristmasUI = meta.story({
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
});
import MockDate from 'mockdate';
import preview from '../.storybook/preview';
import Page from './Page.vue';
const meta = preview.meta({
component: Page,
});
export const ChristmasUI = meta.story({
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
});
import MockDate from 'mockdate';
import preview from '../.storybook/preview';
import Page from './Page.vue';
const meta = preview.meta({
component: Page,
});
export const ChristmasUI = meta.story({
async play({ mount }) {
MockDate.set('2024-12-25');
// ๐ Render the component with the mocked date
await mount();
// ...rest of test
},
});