mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 05:58:56 +08:00
fix(storybook): fix test (#5325)
<img width="440" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/329f9c12-cc0b-4aae-9352-3811ab0a27a6">
This commit is contained in:
@@ -37,16 +37,17 @@ export const SettingPage: StoryFn = () => {
|
||||
};
|
||||
SettingPage.play = async ({ canvasElement, step }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await waitFor(
|
||||
() => {
|
||||
assertExists(canvasElement.querySelector('v-line'));
|
||||
},
|
||||
{
|
||||
timeout: 10000,
|
||||
}
|
||||
);
|
||||
await waitFor(async () => {
|
||||
assertExists(
|
||||
document.body.querySelector(
|
||||
'[data-testid="slider-bar-workspace-setting-button"]'
|
||||
)
|
||||
);
|
||||
});
|
||||
await step('click setting modal button', async () => {
|
||||
await userEvent.click(canvas.getByTestId('settings-modal-trigger'));
|
||||
await userEvent.click(
|
||||
canvas.getByTestId('slider-bar-workspace-setting-button')
|
||||
);
|
||||
});
|
||||
await waitFor(async () => {
|
||||
assertExists(
|
||||
@@ -120,14 +121,13 @@ export const SearchPage: StoryFn = () => {
|
||||
};
|
||||
SearchPage.play = async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await waitFor(
|
||||
() => {
|
||||
assertExists(canvasElement.querySelector('v-line'));
|
||||
},
|
||||
{
|
||||
timeout: 10000,
|
||||
}
|
||||
);
|
||||
await waitFor(async () => {
|
||||
assertExists(
|
||||
document.body.querySelector(
|
||||
'[data-testid="slider-bar-quick-search-button"]'
|
||||
)
|
||||
);
|
||||
});
|
||||
await userEvent.click(canvas.getByTestId('slider-bar-quick-search-button'));
|
||||
await waitFor(
|
||||
() => {
|
||||
@@ -153,6 +153,12 @@ export const ImportPage: StoryFn = () => {
|
||||
};
|
||||
ImportPage.play = async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await waitFor(async () => {
|
||||
assertExists(
|
||||
document.body.querySelector('[data-testid="sidebar-new-page-button"]')
|
||||
);
|
||||
});
|
||||
await userEvent.click(canvas.getByTestId('sidebar-new-page-button'));
|
||||
await waitFor(
|
||||
() => {
|
||||
assertExists(canvasElement.querySelector('v-line'));
|
||||
|
||||
Reference in New Issue
Block a user