refactor: using unified nanoid (#4519)

This commit is contained in:
Alex Yang
2023-09-28 02:53:04 +00:00
committed by GitHub
parent 56f75160f3
commit 603f82ffc2
38 changed files with 258 additions and 183 deletions
+3 -5
View File
@@ -415,11 +415,9 @@ test('image able to download', async ({ page }) => {
const downloadPromise = page.waitForEvent('download');
await locator.getByTestId('download-button').click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toBe(`${blobId}.png`);
await download.saveAs(`download/ + ${download.suggestedFilename()}`);
expect(
fs.existsSync(`download/ + ${download.suggestedFilename()}`)
).toBeTruthy();
const name = download.suggestedFilename();
await download.saveAs(`download/ + ${name}`);
expect(fs.existsSync(`download/ + ${name}`)).toBeTruthy();
});
test('image should only able to move when image is larger than viewport', async ({
@@ -33,9 +33,15 @@ const createAndPinCollection = async (
name: 'test page',
});
await expect(cell).toBeVisible();
await page.getByTestId('create-first-filter').click();
await page.getByTestId(`filler-tag-Created`).click();
await page.getByTestId('save-as-collection').click();
await page.getByTestId('create-first-filter').click({
delay: 200,
});
await page.getByTestId(`filler-tag-Created`).click({
delay: 200,
});
await page.getByTestId('save-as-collection').click({
delay: 200,
});
const title = page.getByTestId('input-collection-title');
await title.isVisible();
await title.fill(options?.collectionName ?? 'test collection');
@@ -90,11 +90,13 @@ test('page delete -> create new page -> refresh page -> new page should be appea
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page1');
await page.waitForTimeout(1000);
const newPageId1 = page.url().split('/').reverse()[0];
await page.getByTestId('all-pages').click();
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page2');
await page.waitForTimeout(1000);
const newPageId2 = page.url().split('/').reverse()[0];
await page.getByTestId('all-pages').click();
await page.reload();