Skip to content

Commit

Permalink
Add test to ensure the CID is deleted when the file is deleted when c…
Browse files Browse the repository at this point in the history
…reating a storage request
  • Loading branch information
2-towns committed Oct 14, 2024
1 parent 679f380 commit c5797c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions e2e/storage-requests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ test('storage request navigation buttons', async ({ page }) => {
await page.getByRole('button', { name: 'Finish' }).click();
await expect(page.locator('.modal--open')).not.toBeVisible();
})

test('remove the CID when the file is deleted', async ({ page }) => {
await page.goto('/dashboard');
await page.getByRole('link', { name: 'Purchases' }).click();
await page.getByRole('button', { name: 'Storage Request' }).click();
await page.locator('div').getByTestId("upload").setInputFiles([
path.join(__dirname, "assets", 'chatgpt.jpg'),
]);
await expect(page.locator('#cid')).toHaveValue("zDvZRwzkvwapyNeL4mzw5gBsZvyn7x8F8Y9n4RYSC7ETBssDYpGe")
await page.locator('.uploadFile-infoRight .buttonIcon--small').click();
await expect(page.locator('#cid')).toHaveValue("")
})

0 comments on commit c5797c6

Please sign in to comment.