diff --git a/e2e/availabilities.spec.ts b/e2e/availabilities.spec.ts index 6306b8a..c64a67d 100644 --- a/e2e/availabilities.spec.ts +++ b/e2e/availabilities.spec.ts @@ -3,7 +3,7 @@ import test, { expect } from "@playwright/test"; test('create an availability', async ({ page }) => { await page.goto('/dashboard/availabilities'); await page.waitForTimeout(500); - await page.locator('.availabilities-create').first().click(); + await page.locator('.availability-edit button').first().click(); await page.getByLabel('Total size').click(); await page.getByLabel('Total size').fill('0.50'); await page.getByLabel('Duration').click(); @@ -17,7 +17,6 @@ test('create an availability', async ({ page }) => { await page.getByLabel('Nickname').fill('test'); await page.getByRole('button', { name: 'Next' }).click(); await expect(page.getByText('Confirm your new sale')).toBeVisible(); - await expect(page.getByText('512.0 MB').first()).toBeVisible(); await page.getByRole('button', { name: 'Next' }).click(); await expect(page.getByText('Success', { exact: true })).toBeVisible(); await page.getByRole('button', { name: 'Finish' }).click(); @@ -27,7 +26,7 @@ test('create an availability', async ({ page }) => { test('availability navigation buttons', async ({ page }) => { await page.goto('/dashboard/availabilities'); await page.waitForTimeout(500); - await page.locator('.availabilities-create').first().click(); + await page.locator('.availability-edit button').first().click(); await expect(page.locator('.stepper-number-done')).not.toBeVisible() await expect(page.locator('.step--active')).toBeVisible() await expect(page.locator('footer .button--primary')).not.toHaveAttribute("disabled"); diff --git a/e2e/folders.spec.ts b/e2e/folders.spec.ts index dbb5e73..dbca687 100644 --- a/e2e/folders.spec.ts +++ b/e2e/folders.spec.ts @@ -4,17 +4,17 @@ test('create a folder', async ({ page }) => { await page.goto('/dashboard'); await page.locator('#folder').click(); await page.locator('#folder').fill('abc'); - await expect(page.getByText('Enter the folder name')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toBeVisible(); await page.locator('#folder').fill('abc '); - await expect(page.getByText('9 alpha characters maximum')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toHaveAttribute("aria-invalid", "true"); await page.locator('#folder').fill('abc !'); - await expect(page.getByText('9 alpha characters maximum')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toHaveAttribute("aria-invalid", "true"); await page.locator('#folder').fill('abc )'); - await expect(page.getByText('9 alpha characters maximum')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toHaveAttribute("aria-invalid", "true"); await page.locator('#folder').fill('Favorites )'); - await expect(page.getByText('This folder already exists')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toHaveAttribute("aria-invalid", "true"); await page.locator('#folder').fill('abc-_'); - await expect(page.getByText('Enter the folder name')).toBeVisible(); + await expect(page.getByPlaceholder('Folder name')).toBeVisible(); await page.getByRole('button', { name: 'Folder' }).click(); - await expect(page.locator('span').filter({ hasText: 'abc-_' })).toBeVisible(); + await expect(page.locator('span').filter({ hasText: 'abc-_' }).first()).toBeVisible(); }) \ No newline at end of file diff --git a/e2e/onboarding.spec.ts b/e2e/onboarding.spec.ts index a8d9e71..e940251 100644 --- a/e2e/onboarding.spec.ts +++ b/e2e/onboarding.spec.ts @@ -19,8 +19,8 @@ test('onboarding steps', async ({ page }) => { await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible() // Codex node - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-error")).not.toBeVisible() - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-success")).toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).not.toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible() // Marketplace await expect(page.locator(".health-checks ul li").nth(4).getByTestId("icon-error")).not.toBeVisible() diff --git a/e2e/settings.spec.ts b/e2e/settings.spec.ts index 6d35e47..94d8192 100644 --- a/e2e/settings.spec.ts +++ b/e2e/settings.spec.ts @@ -14,17 +14,17 @@ test('update the URL with wrong URL applies', async ({ page }) => { await page.getByLabel('Address').click(); await page.getByLabel('Address').fill('hello'); await expect(page.getByLabel('Address')).toHaveAttribute("aria-invalid") - await expect(page.locator(".refresh svg")).toHaveAttribute("aria-disabled") + await expect(page.locator(".refresh svg")).toHaveAttribute("color", "#494949") await page.getByLabel('Address').fill('http://127.0.0.1:8079'); await expect(page.getByLabel('Address')).not.toHaveAttribute("aria-invalid") await expect(page.locator(".refresh svg")).not.toHaveAttribute("aria-disabled") await expect(page.getByLabel('Address')).toHaveValue("http://127.0.0.1") await expect(page.getByLabel('Port')).toHaveValue("8079") await page.locator(".refresh").click() - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-error")).toBeVisible() - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-success")).not.toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).not.toBeVisible() await page.getByLabel('Address').fill('http://127.0.0.1:8080'); await page.locator(".refresh").click() - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-error")).not.toBeVisible() - await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-success")).toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).not.toBeVisible() + await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible() }) \ No newline at end of file diff --git a/e2e/storage-requests.spec.ts b/e2e/storage-requests.spec.ts index 3dd6edf..2cd8531 100644 --- a/e2e/storage-requests.spec.ts +++ b/e2e/storage-requests.spec.ts @@ -20,7 +20,7 @@ test('create a storage request', async ({ page }) => { await expect(page.getByText('Your request is being processed.')).toBeVisible(); await page.getByRole('button', { name: 'Finish' }).click(); await expect(page.getByText('No data.')).not.toBeVisible(); - await page.getByRole('cell', { name: 'pending' }).getByRole('paragraph').click(); + await expect(page.getByTestId('cell-submitted').first()).toBeVisible(); }) test('select a uploaded cid when creating a storage request', async ({ page }) => { @@ -30,7 +30,7 @@ test('select a uploaded cid when creating a storage request', async ({ page }) = ]); await page.locator('a').filter({ hasText: 'Purchases' }).click(); await page.getByRole('button', { name: 'Storage Request' }).click(); - await page.getByPlaceholder('Select or type your CID').click(); + await page.getByPlaceholder('CID').click(); await page.locator('.dropdown ul li').nth(1).click(); await expect(page.getByText('button[disabled]')).not.toBeVisible(); }) @@ -73,6 +73,6 @@ test('remove the CID when the file is deleted', async ({ page }) => { path.join(__dirname, "assets", 'chatgpt.jpg'), ]); await expect(page.locator('#cid')).not.toBeEmpty() - await page.locator('.button-icon--small').click(); + await page.locator('.button-icon--small').nth(1).click(); await expect(page.locator('#cid')).toBeEmpty() }) diff --git a/package-lock.json b/package-lock.json index c6a4f28..73e3b36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.7", "license": "MIT", "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.43", + "@codex-storage/marketplace-ui-components": "0.0.44", "@codex-storage/sdk-js": "^0.0.15", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", @@ -424,9 +424,9 @@ "peer": true }, "node_modules/@codex-storage/marketplace-ui-components": { - "version": "0.0.43", - "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.43.tgz", - "integrity": "sha512-rNhLfbJXu/1ZKh8hTnD2PkUcj/6M0/jHEfHJ86vIgFX4AFPq4+XGMstylx33VZAUYiDCEAc8iyJV/hMXjTNOsA==", + "version": "0.0.44", + "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.44.tgz", + "integrity": "sha512-ZOTQ04OwtFVJ0+MejBiKxi3F5UJRdbLbYN6S9aKvb6ozBYknz3Oxa9wwPVn5r0Gme0A+MwHckx6tnG6EUHclzg==", "dependencies": { "lucide-react": "^0.453.0" }, diff --git a/package.json b/package.json index 8c90b35..84ed4e8 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "React" ], "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.43", + "@codex-storage/marketplace-ui-components": "^0.0.44", "@codex-storage/sdk-js": "^0.0.15", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", diff --git a/src/assets/icons/success-circle.svg b/src/assets/icons/success-circle.svg index 6aea5db..14218d4 100644 --- a/src/assets/icons/success-circle.svg +++ b/src/assets/icons/success-circle.svg @@ -1,4 +1,5 @@ { errored: ErrorCircleIcon, }; - const states = { - cancelled: "error", - errored: "error", - pending: "warning", - started: "loading", - submitted: "loading", - finished: "success", - }; - const Icon = icons[state as keyof typeof icons] || PurchaseStateIcon; return ( -

+

{message ? ( - + ) : ( - + )}

diff --git a/src/components/StorageRequestSetup/StorageRequestFileChooser.tsx b/src/components/StorageRequestSetup/StorageRequestFileChooser.tsx index dae27c7..1c2601c 100644 --- a/src/components/StorageRequestSetup/StorageRequestFileChooser.tsx +++ b/src/components/StorageRequestSetup/StorageRequestFileChooser.tsx @@ -67,7 +67,7 @@ export function StorageRequestFileChooser({ id="cid" placeholder="CID" onChange={onChange} - value={storageRequest.cid} + value={storageRequest.cid || ""} options={options} onSelected={onSelected} size="medium"