From ffe8d0f2ee3cc3f45089613eb20c2a306a5d2076 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Wed, 20 May 2026 08:41:06 +0900 Subject: [PATCH] test(assets): drop OSS legacy sidebar tree tests (FE-729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After FE-729 the model-library sidebar tab routes to the Asset Browser dialog and never renders ModelLibrarySidebarTab.vue. The legacy sidebar-tree tests now validate dead code paths: - delete browser_tests/tests/sidebar/modelLibrary.spec.ts entirely (tab/folders/search/refresh/empty-state — all dead) - drop the model-library entry from the defaultKeybindings sidebar toggle table (KeyM no longer toggles a panel) - remove the Refresh-clears-resolved-missing-model case from errorsTabMissingModels.spec.ts — it waited for the legacy /experiment/models endpoint that modelStore no longer hits Dialog-flow coverage for the new entry point belongs to FE-732. --- .../tests/defaultKeybindings.spec.ts | 1 - .../errorsTabMissingModels.spec.ts | 37 --- .../tests/sidebar/modelLibrary.spec.ts | 236 ------------------ 3 files changed, 274 deletions(-) delete mode 100644 browser_tests/tests/sidebar/modelLibrary.spec.ts diff --git a/browser_tests/tests/defaultKeybindings.spec.ts b/browser_tests/tests/defaultKeybindings.spec.ts index 54ea64f90d..b5bd02a94a 100644 --- a/browser_tests/tests/defaultKeybindings.spec.ts +++ b/browser_tests/tests/defaultKeybindings.spec.ts @@ -27,7 +27,6 @@ test.describe('Default Keybindings', { tag: '@keyboard' }, () => { const sidebarTabs = [ { key: 'KeyW', tabId: 'workflows', label: 'workflows' }, { key: 'KeyN', tabId: 'node-library', label: 'node library' }, - { key: 'KeyM', tabId: 'model-library', label: 'model library' }, { key: 'KeyA', tabId: 'assets', label: 'assets' } ] as const diff --git a/browser_tests/tests/propertiesPanel/errorsTabMissingModels.spec.ts b/browser_tests/tests/propertiesPanel/errorsTabMissingModels.spec.ts index 41b40cf977..ffad3073fa 100644 --- a/browser_tests/tests/propertiesPanel/errorsTabMissingModels.spec.ts +++ b/browser_tests/tests/propertiesPanel/errorsTabMissingModels.spec.ts @@ -115,42 +115,5 @@ test.describe('Errors tab - Missing models', { tag: '@ui' }, () => { comfyPage.page.getByTestId(TestIds.dialogs.missingModelRefresh) ).toBeVisible() }) - - test('Should clear resolved missing model when Refresh is clicked', async ({ - comfyPage - }) => { - await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models') - await comfyPage.page.route(/\/object_info$/, async (route) => { - const response = await route.fetch() - const objectInfo = await response.json() - const ckptName = - objectInfo.CheckpointLoaderSimple.input.required.ckpt_name - ckptName[0] = [...ckptName[0], 'fake_model.safetensors'] - await route.fulfill({ response, json: objectInfo }) - }) - - const objectInfoResponse = comfyPage.page.waitForResponse((response) => { - const url = new URL(response.url()) - return url.pathname.endsWith('/object_info') && response.ok() - }) - const modelFoldersResponse = comfyPage.page.waitForResponse( - (response) => { - const url = new URL(response.url()) - return url.pathname.endsWith('/experiment/models') && response.ok() - } - ) - const refreshButton = comfyPage.page.getByTestId( - TestIds.dialogs.missingModelRefresh - ) - - await Promise.all([ - objectInfoResponse, - modelFoldersResponse, - refreshButton.click() - ]) - await expect( - comfyPage.page.getByTestId(TestIds.dialogs.missingModelsGroup) - ).toBeHidden() - }) }) }) diff --git a/browser_tests/tests/sidebar/modelLibrary.spec.ts b/browser_tests/tests/sidebar/modelLibrary.spec.ts deleted file mode 100644 index b49adc7cd5..0000000000 --- a/browser_tests/tests/sidebar/modelLibrary.spec.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { expect } from '@playwright/test' - -import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage' - -const MOCK_FOLDERS: Record = { - checkpoints: [ - 'sd_xl_base_1.0.safetensors', - 'dreamshaper_8.safetensors', - 'realisticVision_v51.safetensors' - ], - loras: ['detail_tweaker_xl.safetensors', 'add_brightness.safetensors'], - vae: ['sdxl_vae.safetensors'] -} - -// ========================================================================== -// 1. Tab open/close -// ========================================================================== - -test.describe('Model library sidebar - tab', () => { - test.beforeEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles(MOCK_FOLDERS) - await comfyPage.setup() - }) - - test.afterEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.clearMocks() - }) - - test('Opens model library tab and shows tree', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await expect(tab.modelTree).toBeVisible() - await expect(tab.searchInput).toBeVisible() - }) - - test('Shows refresh and load all folders buttons', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await expect(tab.refreshButton).toBeVisible() - await expect(tab.loadAllFoldersButton).toBeVisible() - }) -}) - -// ========================================================================== -// 2. Folder display -// ========================================================================== - -test.describe('Model library sidebar - folders', () => { - // Mocks are set up before setup(), so app.ts's loadModelFolders() - // call during initialization hits the mock and populates the store. - test.beforeEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles(MOCK_FOLDERS) - await comfyPage.setup() - }) - - test.afterEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.clearMocks() - }) - - test('Displays model folders after opening tab', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await expect(tab.getFolderByLabel('checkpoints')).toBeVisible() - await expect(tab.getFolderByLabel('loras')).toBeVisible() - await expect(tab.getFolderByLabel('vae')).toBeVisible() - }) - - test('Expanding a folder loads and shows models', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - // Click the folder to expand it - await tab.getFolderByLabel('checkpoints').click() - - // Models should appear as leaf nodes - await expect(tab.getLeafByLabel('sd_xl_base_1.0')).toBeVisible() - await expect(tab.getLeafByLabel('dreamshaper_8')).toBeVisible() - await expect(tab.getLeafByLabel('realisticVision_v51')).toBeVisible() - }) - - test('Expanding a different folder shows its models', async ({ - comfyPage - }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await tab.getFolderByLabel('loras').click() - - await expect(tab.getLeafByLabel('detail_tweaker_xl')).toBeVisible() - await expect(tab.getLeafByLabel('add_brightness')).toBeVisible() - }) -}) - -// ========================================================================== -// 3. Search -// ========================================================================== - -test.describe('Model library sidebar - search', () => { - test.beforeEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles(MOCK_FOLDERS) - await comfyPage.setup() - }) - - test.afterEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.clearMocks() - }) - - test('Search filters models by filename', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await tab.searchInput.fill('dreamshaper') - - // Wait for debounce (300ms) + load + render - await expect(tab.getLeafByLabel('dreamshaper_8')).toBeVisible() - - // Other models should not be visible - await expect(tab.getLeafByLabel('sd_xl_base_1.0')).toBeHidden() - }) - - test('Clearing search restores folder view', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await tab.searchInput.fill('dreamshaper') - await expect(tab.getLeafByLabel('dreamshaper_8')).toBeVisible() - - // Clear the search - await tab.searchInput.fill('') - - // Folders should be visible again (collapsed) - await expect(tab.getFolderByLabel('checkpoints')).toBeVisible() - await expect(tab.getFolderByLabel('loras')).toBeVisible() - }) - - test('Search with no matches shows empty tree', async ({ comfyPage }) => { - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - // Expand a folder and verify models are present before searching - await tab.getFolderByLabel('checkpoints').click() - await expect(tab.leafNodes).not.toHaveCount(0) - - await tab.searchInput.fill('nonexistent_model_xyz') - - // Wait for debounce, then verify no leaf nodes - await expect.poll(() => tab.leafNodes.count()).toBe(0) - }) -}) - -// ========================================================================== -// 4. Refresh and load all -// ========================================================================== - -test.describe('Model library sidebar - refresh', () => { - test.afterEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.clearMocks() - }) - - test('Refresh button reloads folder list', async ({ comfyPage }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles({ - checkpoints: ['model_a.safetensors'] - }) - await comfyPage.setup() - - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await expect(tab.getFolderByLabel('checkpoints')).toBeVisible() - - // Update mock to include a new folder - await comfyPage.modelLibrary.clearMocks() - await comfyPage.modelLibrary.mockFoldersWithFiles({ - checkpoints: ['model_a.safetensors'], - loras: ['lora_b.safetensors'] - }) - - // Wait for the refresh request to complete - const refreshRequest = comfyPage.page.waitForRequest( - (req) => req.url().endsWith('/experiment/models'), - { timeout: 5000 } - ) - await tab.refreshButton.click() - await refreshRequest - - await expect(tab.getFolderByLabel('loras')).toBeVisible() - }) - - test('Load all folders button triggers loading all model data', async ({ - comfyPage - }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles(MOCK_FOLDERS) - await comfyPage.setup() - - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - // Wait for a per-folder model files request triggered by load all - const folderRequest = comfyPage.page.waitForRequest( - (req) => - /\/api\/experiment\/models\/[^/]+$/.test(req.url()) && - req.method() === 'GET', - { timeout: 5000 } - ) - - await tab.loadAllFoldersButton.click() - await folderRequest - }) -}) - -// ========================================================================== -// 5. Empty state -// ========================================================================== - -test.describe('Model library sidebar - empty state', () => { - test.afterEach(async ({ comfyPage }) => { - await comfyPage.modelLibrary.clearMocks() - }) - - test('Shows empty tree when no model folders exist', async ({ - comfyPage - }) => { - await comfyPage.modelLibrary.mockFoldersWithFiles({}) - await comfyPage.setup() - - const tab = comfyPage.menu.modelLibraryTab - await tab.open() - - await expect(tab.modelTree).toBeVisible() - await expect(tab.folderNodes).toHaveCount(0) - await expect(tab.leafNodes).toHaveCount(0) - }) -})