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:
pengx17
2025-05-06 09:45:40 +00:00
parent 53c531c931
commit 3ac92d0d27
2 changed files with 9 additions and 2 deletions

View File

@@ -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();
});