feat(app): notification capability with transition dedupe
This commit is contained in:
@@ -7,10 +7,11 @@
|
||||
// replaced with a recording spy before the app loads, and the real browser
|
||||
// permission is granted (or denied) through CDP, so the drive proves the real
|
||||
// bridge's behaviour: the initial seed raises nothing, one live transition
|
||||
// raises exactly one notification with the entry's own words and run+kind+marker
|
||||
// identity, a dismissed transition and a reconnect replay raise none, and the
|
||||
// Settings tile reads honestly in every state on both hosts at 320 logical px
|
||||
// and 2x text. One PNG is written per captured state.
|
||||
// raises exactly one notification with the entry's own words and run+kind
|
||||
// identity, a dismissed transition and a reconnect replay raise none, a second
|
||||
// decision gate of one run raises a fresh notification (the waiting shape has no
|
||||
// finished_at), and the Settings tile reads honestly in every state on both
|
||||
// hosts at 320 logical px and 2x text. One PNG is written per captured state.
|
||||
import { createServer } from 'node:http';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { once } from 'node:events';
|
||||
@@ -217,7 +218,7 @@ try {
|
||||
check('transition count', posted.length === 1, JSON.stringify(posted));
|
||||
check('transition title', posted[0].title === 'A run failed', JSON.stringify(posted[0]));
|
||||
check('transition body', posted[0].body === 'Nightly audit · nightly', JSON.stringify(posted[0]));
|
||||
check('transition identity', /^1:Failed@/.test(posted[0].tag), JSON.stringify(posted[0]));
|
||||
check('transition identity', posted[0].tag === '1:Failed', JSON.stringify(posted[0]));
|
||||
await capture('notification-transition-material-dark-320-2x.png');
|
||||
captures.push('notification-transition-material-dark-320-2x.png');
|
||||
|
||||
@@ -233,6 +234,24 @@ try {
|
||||
check('reconnect posted once', reconnectReport.includes('posted=1'), reconnectReport);
|
||||
check('reconnect count', JSON.parse(await notifications()).length === 1, await notifications());
|
||||
|
||||
// 4b. A second decision gate of one run notifies again. The waiting frames
|
||||
// carry no finished_at, so the run's timestamps cannot tell the gates apart.
|
||||
await navigate({ mode: 'secondgate' });
|
||||
const secondGateReport = await waitForReport('secondgate');
|
||||
check('second gate posted twice', secondGateReport.includes('posted=2'), secondGateReport);
|
||||
const gates = JSON.parse(await notifications());
|
||||
check('second gate count', gates.length === 2, JSON.stringify(gates));
|
||||
check(
|
||||
'second gate identity',
|
||||
gates.every((item) => item.tag === '7:Decision'),
|
||||
JSON.stringify(gates),
|
||||
);
|
||||
check(
|
||||
'second gate title',
|
||||
gates.every((item) => item.title === 'A run needs your decision'),
|
||||
JSON.stringify(gates),
|
||||
);
|
||||
|
||||
// 5. A denied page is honest and posts nothing.
|
||||
await deny();
|
||||
await navigate({ mode: 'denied', semantics: true });
|
||||
|
||||
Reference in New Issue
Block a user