mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
test(core): enable no-floating-promises rule for tests (#11915)
Sometimes, missing `await` in the test code can cause timing issues, leading to test failures. This PR enables the `no-floating-promises` rule for the test code to ensure that such errors do not occur.
This commit is contained in:
@@ -164,7 +164,7 @@ test('can sync svg between different browsers', async ({ page, browser }) => {
|
||||
const fileChooserPromise = page.waitForEvent('filechooser');
|
||||
await page.keyboard.press('Enter', { delay: 50 });
|
||||
const fileChooser = await fileChooserPromise;
|
||||
fileChooser.setFiles(Path.dir(import.meta.url).join('logo.svg').value);
|
||||
await fileChooser.setFiles(Path.dir(import.meta.url).join('logo.svg').value);
|
||||
await expect(image).toBeVisible();
|
||||
|
||||
// the user should see the svg
|
||||
|
||||
@@ -28,6 +28,6 @@ test('import from template should work', async ({ page }) => {
|
||||
const btn = page.getByTestId('import-template-to-workspace-btn');
|
||||
|
||||
await btn.isVisible();
|
||||
btn.click();
|
||||
await btn.click();
|
||||
await waitForEditorLoad(page);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user