Add the web interface
Plain HTML, CSS and JavaScript modules, with no build step. Hash routes and relative URLs make it work under any path. The job list is polled: every 2 seconds while a job runs, and less often otherwise.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { test } from 'node:test';
|
||||
import { install, server, settle } from './flow-helpers.mjs';
|
||||
|
||||
const ui = install();
|
||||
|
||||
test('startup failure reports the API error rather than leaving a blank application', async (t) => {
|
||||
const backend = server(t);
|
||||
backend.on('GET', 'auth/check', { error: 'Service unavailable' }, 503);
|
||||
await import('../../bindery/static/js/main.js');
|
||||
await settle();
|
||||
assert.match(ui.app.textContent, /Service unavailable/);
|
||||
assert.deepEqual(backend.requests.map((r) => r.path), ['auth/check']);
|
||||
});
|
||||
Reference in New Issue
Block a user