storybook/docs/_snippets/mount-basic.md
Kyle Gach f1b57d0d79 Updates
- Prose tweaks, adding links for context
- Use `If` blocks for conditional content
- Restructure content to be story, component, project-ordered
- Update headings to be problem-oriented
2024-07-08 14:59:03 -06:00

45 lines
980 B
Markdown

```js filename="Page.stories.js" renderer="common" language="js"
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
},
};
```
```ts filename="Page.stories.ts" renderer="common" language="ts-4-9"
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
},
};
```
```ts filename="Page.stories.ts" renderer="common" language="ts"
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
},
};
```