Expand portal UI edge state coverage
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 4m53s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 15s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 1m42s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 4s

This commit is contained in:
2026-10-26 16:51:12 +00:00
parent cf407a2c13
commit d6b2357371
+41
View File
@@ -229,4 +229,45 @@ test.describe('ComfyUI Portal read-only UI states', () => {
await expect.poll(() => requests).toEqual([]);
await expect(page.getByRole('button', { name: 'Restart ComfyUI' })).toBeEnabled();
});
test('shows an indeterminate working state when running progress is unavailable', async ({ page }) => {
const running = { promptId: 'running-unknown', title: 'Working without progress', status: 'running', queuedAt: Date.now() - 5000, durationMs: null, outputCount: 0, assets: [], models: [], progress: null };
await mockReadOnlyApi(page, { running });
await page.goto('/jobs');
await expect(page.getByText('Working…')).toBeVisible();
await expect(page.locator('.progress-track.indeterminate')).toBeVisible();
});
test('uses safe fallbacks when connected server metadata is missing', async ({ page }) => {
const server = { ...connectedServer, version: '', os: '', pythonVersion: '', devices: [] };
await mockReadOnlyApi(page, { server });
await page.goto('/jobs');
await expect(page.getByText('Connected', { exact: true })).toBeVisible();
await expect(page.getByText('Unknown', { exact: true })).toHaveCount(3);
await expect(page.locator('.devices')).toHaveCount(0);
});
test('keeps Manager controls safe when Manager status is unavailable', async ({ page }) => {
await mockReadOnlyApi(page, { manager: 'unavailable' });
await page.goto('/jobs');
await expect(page.getByText('Runtime controls')).toBeVisible();
await expect(page.getByText('ComfyUI Manager —')).toBeVisible();
await expect(page.locator('select')).toBeDisabled();
await expect(page.getByRole('button', { name: 'Switch version' })).toBeDisabled();
});
test('shows the accepted message after a confirmed control request using only mocked APIs', async ({ page }) => {
const requests = [];
await mockReadOnlyApi(page);
await page.route('**/api/comfy/restart', async (route) => {
requests.push(route.request().method());
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ message: 'Request accepted.' }) });
});
await page.goto('/jobs');
page.once('dialog', dialog => dialog.accept());
await page.getByRole('button', { name: 'Restart ComfyUI' }).click();
await expect(page.getByText('Request accepted.')).toBeVisible();
await expect.poll(() => requests).toEqual(['POST']);
await expect(page.getByRole('button', { name: 'Restart ComfyUI' })).toBeEnabled();
});
});