From fc759232116e9f28492f83de184ca772e63e8188 Mon Sep 17 00:00:00 2001 From: trueheads Date: Mon, 22 Dec 2025 02:18:29 -0600 Subject: [PATCH] e2e component rename --- apps/ui/tests/context-view.spec.ts | 34 ++++++------------------------ 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/apps/ui/tests/context-view.spec.ts b/apps/ui/tests/context-view.spec.ts index 8745568c..ed71b8ff 100644 --- a/apps/ui/tests/context-view.spec.ts +++ b/apps/ui/tests/context-view.spec.ts @@ -205,36 +205,16 @@ test.describe('Context View - File Management', () => { await navigateToContext(page); - // Click Add File button - await clickElement(page, 'add-context-file'); - await page.waitForSelector('[data-testid="add-context-dialog"]', { - timeout: 5000, - }); + // Use the hidden file input to upload an image directly + // The "Import File" button triggers this input + const fileInput = page.locator('[data-testid="file-import-input"]'); + await fileInput.setInputFiles(TEST_IMAGE_SRC); - // Select image type - await clickElement(page, 'add-image-type'); - - // Enter filename - await fillInput(page, 'new-file-name', 'test-image.png'); - - // Upload image using file input - await page.setInputFiles('[data-testid="image-upload-input"]', TEST_IMAGE_SRC); - - // Wait for image preview to appear (indicates upload success) - const addDialog = await getByTestId(page, 'add-context-dialog'); - await addDialog.locator('img').waitFor({ state: 'visible' }); - - // Click confirm - await clickElement(page, 'confirm-add-file'); - - // Wait for dialog to close - await page.waitForFunction( - () => !document.querySelector('[data-testid="add-context-dialog"]'), - { timeout: 5000 } - ); + // Wait for file to appear in the list (filename is extracted from path) + await waitForContextFile(page, 'logo.png', 10000); // Verify file appears in list - const fileButton = await getByTestId(page, 'context-file-test-image.png'); + const fileButton = await getByTestId(page, 'context-file-logo.png'); await expect(fileButton).toBeVisible(); // Click on the image to view it