fix(core): avoid page full refresh (#3341)

Co-authored-by: Peng Xiao <pengxiao@outlook.com>
This commit is contained in:
Alex Yang
2023-07-24 02:02:35 -07:00
committed by GitHub
parent ccb0df10e4
commit e6e98975ed
18 changed files with 276 additions and 433 deletions

View File

@@ -42,6 +42,7 @@ const createAndPinCollection = async (
await page.getByTestId('collection-bar-option-pin').click();
await page.waitForTimeout(100);
};
test('Show collections items in sidebar', async ({ page }) => {
await createAndPinCollection(page);
const collections = page.getByTestId('collections');

View File

@@ -15,10 +15,9 @@ test('goto not found page', async ({ page }) => {
test('goto not found workspace', async ({ page }) => {
await openHomePage(page);
await waitEditorLoad(page);
const currentUrl = page.url();
// if doesn't wait for timeout, data won't be saved into indexedDB
await page.waitForTimeout(1000);
await page.goto(new URL('/workspace/invalid/all', webUrl).toString());
await waitEditorLoad(page);
expect(page.url()).toEqual(currentUrl);
await page.waitForTimeout(1000);
expect(page.url()).toBe(new URL('/404', webUrl).toString());
});