From c5797c6ebf3bd26b3d4d33872abfcd8203bda14c Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 14 Oct 2024 16:49:14 +0200 Subject: [PATCH] Add test to ensure the CID is deleted when the file is deleted when creating a storage request --- e2e/storage-requests.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/e2e/storage-requests.spec.ts b/e2e/storage-requests.spec.ts index 54dbcb4..322c6c0 100644 --- a/e2e/storage-requests.spec.ts +++ b/e2e/storage-requests.spec.ts @@ -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("") +})