theme | class | highlighter | info | drawings | css | layout | image | |
---|---|---|---|---|---|---|---|---|
geist |
text-center |
shiki |
## Slidev Starter Template
Presentation slides for developers.
Learn more at [Sli.dev](https://sli.dev)
|
|
unocss |
image |
/book.jpg |
::right::
<style> h1 { color: #FE4785 } </style>// ReportFiltersCheckbox.stories.tsx
export const UncheckAll = {
name: '全てのチェックを外せること',
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
// 全てのチェックを外す
await userEvent.click(
canvas.getByRole('checkbox', { name: 'パブリシティ' }),
);
await userEvent.click(
canvas.getByRole('checkbox', { name: 'パブリシティ転載' }),
);
await userEvent.click(
canvas.getByRole('checkbox', { name: 'リリース原文転載' }),
);
},
} satisfies Story;
::right::
<style> .slidev-layout { gap: 8px } </style><style> .col-right { display: flex; flex-direction: column; justify-content: center; } </style>
::right::
// ReportFiltersCheckbox.test.tsx
import { composeStories } from '@storybook/react';
import { render } from '@testing-library/react';
import * as stories from './ReportFiltersCheckbox.stories';
const { UncheckAll } = composeStories(stories);
it('全てのチェックを外せること', async () => {
const { container, getByRole } = render(<UncheckAll />);
await UncheckAll.play({ canvasElement: container });
expect(getByRole('checkbox', { name: 'パブリシティ' })).not.toBeChecked();
expect(
getByRole('checkbox', { name: 'パブリシティ転載' }),
).not.toBeChecked();
expect(
getByRole('checkbox', { name: 'リリース原文転載' }),
).not.toBeChecked();
});
実装とFigmaのズレを減らしたかった
Chromaticを導入しないといけなかったので断念
<style> h1 { margin-top: 1rem } </style>Assertを独立して書くので、テストの意図が明確になった。
Assert後にActするようなパターンも書きづらくなった。
mswなどを使ってmockできる部分とそうでない部分がある
・境界があいまい
・すべてを Storybook に寄せることは不可能
・mockがStorybookに導入されたら?
<style> h1 { margin-top: 1rem } </style>We have a long list of quality of life improvements here that we’ll be rolling out in 7.x, especially around better mocking, full page testing, and compatibility.1
デザイナーは figma を見るし、QA は staging を見る
エンジニアもそんなに Storybook を見ない
・バックエンドができるまでの開発
・テストの説明
<style> h1 { margin-top: 1rem } </style>