mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 22:07:09 +08:00
chore(core): update onboarding snapshot (#12138)
fix AF-2590 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Improved the flexibility of the "Unused blobs" count test by dynamically verifying the count before and after deletion, instead of relying on hardcoded values. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -48,8 +48,13 @@ test('should show blob management dialog', async ({ page }) => {
|
||||
await expect(page.getByTestId('setting-modal')).toBeVisible();
|
||||
await page.getByTestId('workspace-setting:storage').click();
|
||||
await expect(page.getByTestId('blob-preview-card')).toHaveCount(9);
|
||||
await expect(page.getByText('Unused blobs (14)')).toBeVisible();
|
||||
|
||||
// get the unused blobs count
|
||||
const count = await page.getByText(/Unused blobs \(\d+\)/).textContent();
|
||||
const unusedBlobsCount = parseInt(count?.match(/\d+/)?.[0] ?? '0');
|
||||
|
||||
// count should > 9
|
||||
expect(unusedBlobsCount).toBeGreaterThan(9);
|
||||
await page.getByTestId('blob-preview-card').nth(0).click();
|
||||
await expect(page.getByText('1 Selected')).toBeVisible();
|
||||
|
||||
@@ -57,5 +62,7 @@ test('should show blob management dialog', async ({ page }) => {
|
||||
await expect(page.getByText('Delete blob files')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await expect(page.getByText('Unused blobs (13)')).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(`Unused blobs (${unusedBlobsCount - 1})`)
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user