mirror of
https://github.com/Zakkaus/doona.git
synced 2026-12-06 16:01:00 +00:00
The source table could not hold a usage meter without breaking its row rhythm. Sources now render as an S2 CardView (size M, regular density): each card lists the source's facts in two columns and its usage as a full-width fact, with a meter track under the value when the source has an allowance. Selection and arrow keys pick the source whose nodes are listed below. Date-times across the app use a 24-hour clock.
29 lines
1.6 KiB
TypeScript
29 lines
1.6 KiB
TypeScript
import {expect, faults, test} from './fixtures';
|
|
|
|
// Actions the faults scenario refuses the way honk would, through the mock rather than intercepted routes.
|
|
test.use({storage: faults});
|
|
|
|
test('a file saved on disk after the last reload refuses writes until honk reloads it', async ({page}) => {
|
|
await page.goto('/#/config?source=src-rules');
|
|
const editor = page.locator('.cm-content');
|
|
await expect(editor).toHaveAttribute('contenteditable', 'true');
|
|
await editor.fill((await editor.innerText()) + '\n# faults draft\n');
|
|
const toolbar = page.locator('.rp-editor-toolbar');
|
|
await toolbar.getByRole('button', {name: 'Apply', exact: true}).click();
|
|
await expect(page.locator('.rp-toast.negative')).toContainText('changed');
|
|
await toolbar.getByRole('button', {name: 'Apply', exact: true}).click();
|
|
await expect(page.locator('.rp-toast.negative', {hasText: 'not the running configuration'})).toContainText('Reload honk to apply the file');
|
|
await expect(editor).toContainText('# faults draft');
|
|
});
|
|
|
|
test('a subscription whose host fails keeps its cached nodes and says why the refresh failed', async ({page}) => {
|
|
await page.goto('/#/nodes?tab=list');
|
|
const source = page.getByRole('grid', {name: 'Node sources', exact: true}).getByRole('row', {name: 'harbor'});
|
|
await expect(source).toContainText('Stale');
|
|
await page.getByRole('button', {name: 'Update harbor', exact: true}).click();
|
|
await expect(page.locator('.rp-toast.negative', {hasText: 'Could not update harbor'})).toContainText(
|
|
'Could not fetch the subscription; the active nodes are kept'
|
|
);
|
|
await expect(source).toContainText('Stale');
|
|
});
|