The failure mode on a write form is the one nobody demos
The console now writes, so the question stopped being "does the table show the ban" and became "what happens when the operator types the wrong thing". A form that accepts `not-an-ip`, says nothing, and adds no row leaves an operator believing an address is blocked when it is not — which is worse than giving them no console at all. Two assertions added to the browser gate. The API already rejected the value (`BlockStore.AddOperatorAsync` returns `not an IP address: not-an-ip`, the endpoint answers 400, the page already surfaces `body.error` in its status line); what is new is that a gate now proves that chain instead of assuming it. The run prints the actual string: `not an IP address: not-an-ip`, and no phantom row in the bans table. Console gate: **26/26**. Also measured, because a timeout written at a desk is a guess: the Linux rehearsal (`scripts/ci-linux-rehearsal.sh`, added in `42d4af9`) was re-run with `time`. Cold container, cold NuGet cache, Ubuntu 24.04.5, SDK 10.0.401: **1:02.81** wall for restore + build + unit + integration + smoke. The source job's `timeout-minutes: 25` is not close, even allowing for a runner's slower CPU. Before this, the number in the workflow was folklore from a build that once stalled ~12 minutes on a single apt-get step. No source-tree change in this commit: gate assertions and the numbers written down where the next reader will look for them. Unchanged and still said plainly: no job of this workflow has executed on a runner — the repository has no remote.
This commit is contained in:
@@ -174,6 +174,22 @@ const rgb = (s) => s.match(/\d+/g).slice(0, 3).map(Number);
|
||||
(await page.$$eval('#allow tbody tr', (r) => r.map((tr) => tr.children[0].textContent))).indexOf(WRITE_CIDR) === -1,
|
||||
JSON.stringify(await page.$$eval('#allow tbody tr', (r) => r.map((tr) => tr.children[0].textContent))));
|
||||
|
||||
// The failure mode worth asserting on a write form is the quiet one: the
|
||||
// operator believes they blocked an address and did not. A typo in the field
|
||||
// must come back as the API's own error, not as a status line that says
|
||||
// nothing and a table that gains no row.
|
||||
await page.fill('#blockIp', 'not-an-ip');
|
||||
await page.click('#addBlock');
|
||||
await page.waitForFunction(
|
||||
() => /not an IP address/.test(document.getElementById('status').textContent),
|
||||
null, { timeout: 10000 }).catch(() => {});
|
||||
const errStatus = (await page.textContent('#status')).replace(/\s+/g, ' ').trim();
|
||||
const rowsAfterBad = await cells('#blocks tbody tr');
|
||||
check('a bad address in the block form surfaces the API error instead of looking like success',
|
||||
/not an IP address/.test(errStatus), errStatus);
|
||||
check('and no phantom row appears for the address that was rejected',
|
||||
!rowsAfterBad.some((r) => r[0] === 'not-an-ip'), JSON.stringify(rowsAfterBad.map((r) => r[0])));
|
||||
|
||||
// The country rule toggle is the one control here that changes policy for
|
||||
// everyone, so the gate turns it and turns it back. There is no DELETE for a
|
||||
// country rule — PUT allowed=true is as close to "back to how it was" as the
|
||||
|
||||
Reference in New Issue
Block a user