Add model and update result UI coverage
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 4m59s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 15s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 1m55s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 5s
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 4m59s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 15s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 1m55s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 5s
This commit is contained in:
@@ -398,4 +398,44 @@ test.describe('ComfyUI Portal read-only UI states', () => {
|
||||
await expect(page.getByText('Manager rejected update')).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Update all' })).toBeEnabled();
|
||||
});
|
||||
|
||||
test('renders model chips with their node-type tooltips on completed jobs', async ({ page }) => {
|
||||
const jobs = [{ promptId: 'model-chips', title: 'Model details', status: 'completed', queuedAt: 1000, durationMs: 65000, outputCount: 0, assets: [], models: [
|
||||
{ nodeId: '4', type: 'CheckpointLoaderSimple', name: 'checkpoint.safetensors' },
|
||||
{ nodeId: '8', type: 'LoraLoader', name: 'style.safetensors' },
|
||||
], progress: null }];
|
||||
await mockReadOnlyApi(page, { jobs });
|
||||
await page.goto('/jobs');
|
||||
const models = page.locator('.job .models span');
|
||||
await expect(models).toHaveCount(2);
|
||||
await expect(models.nth(0)).toHaveAttribute('title', 'CheckpointLoaderSimple');
|
||||
await expect(models.nth(1)).toHaveAttribute('title', 'LoraLoader');
|
||||
await expect(page.getByText('1m 5s')).toBeVisible();
|
||||
});
|
||||
|
||||
test('keeps the stats panel within a narrow mobile viewport', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 320, height: 700 });
|
||||
await mockReadOnlyApi(page, { stats: { totalJobs: 123, totalModels: 2, models: [{ name: 'a-very-long-model-name-that-must-not-create-horizontal-overflow.safetensors', jobCount: 123 }, { name: 'second.safetensors', jobCount: 1 }] } });
|
||||
await page.goto('/jobs');
|
||||
await expect(page.getByRole('heading', { name: 'Most used models' })).toBeVisible();
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1);
|
||||
expect(overflow, 'persistent model stats should not create horizontal scrolling').toBe(false);
|
||||
});
|
||||
|
||||
test('renders update-all completion results from mocked status polling', async ({ page }) => {
|
||||
const result = { comfyui: 'Updated', updated: [{ id: 'node-a', title: 'Node A', url: '', error: '' }], skipped: [{ id: 'node-b', title: 'Node B', url: '', error: '' }], failed: [{ id: 'node-c', title: 'Node C', url: '', error: 'Permission denied' }], completedAt: Date.now() };
|
||||
await mockReadOnlyApi(page);
|
||||
await page.route('**/api/comfy/update-all', async route => route.fulfill({ status: 202, contentType: 'application/json', body: JSON.stringify({ message: 'started' }) }));
|
||||
await page.route('**/api/comfy/update-status', async route => route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ status: { total_count: 3, done_count: 3, in_progress_count: 0, is_processing: false }, progress: null, result }) }));
|
||||
await page.goto('/jobs');
|
||||
page.once('dialog', dialog => dialog.accept());
|
||||
await page.getByRole('button', { name: 'Update all' }).click();
|
||||
await expect(page.getByText('Update all started. Checking progress…')).toBeVisible();
|
||||
await page.waitForTimeout(5200);
|
||||
await expect(page.getByText('Update all completed. See the results below.')).toBeVisible();
|
||||
await expect(page.getByText('Node A')).toBeVisible();
|
||||
await expect(page.getByText('Node B')).toBeVisible();
|
||||
await expect(page.getByText('Node C')).toBeVisible();
|
||||
await expect(page.getByText('Permission denied')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user