wired PICK SKY server-side polarity countdown via threading.Timer (tasks.py); fixed polarity_done overlay gating on refresh; cleared sig-select floats on overlay dismiss; filtered Redact events from Most Recent applet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,8 @@ describe("SigSelect", () => {
|
||||
data-polarity="${polarity}"
|
||||
data-user-role="${userRole}"
|
||||
data-reserve-url="/epic/room/test/sig-reserve"
|
||||
data-ready-url="/epic/room/test/sig-ready"
|
||||
|
||||
data-reservations="${reservations.replace(/"/g, '"')}">
|
||||
<div class="sig-modal">
|
||||
<div class="sig-stage">
|
||||
@@ -605,4 +607,79 @@ describe("SigSelect", () => {
|
||||
expect(testDiv.querySelector(".fan-card-correspondence").textContent).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
// ── WAIT NVM glow pulse ────────────────────────────────────────────────────── //
|
||||
//
|
||||
// After clicking TAKE SIG (POST ok → isReady=true) a setInterval pulses the
|
||||
// button at 600ms: odd ticks add .btn-cancel + a --terOr outer box-shadow;
|
||||
// even ticks remove both. Uses jasmine.clock() to advance the fake timer.
|
||||
|
||||
describe("WAIT NVM glow pulse", () => {
|
||||
let takeSigBtn;
|
||||
|
||||
beforeEach(() => {
|
||||
jasmine.clock().install();
|
||||
// Pre-reserve card 42 as PC so _showTakeSigBtn() fires during init
|
||||
makeFixture({ reservations: '{"42":"PC"}' });
|
||||
takeSigBtn = document.getElementById("id_take_sig_btn");
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jasmine.clock().uninstall();
|
||||
});
|
||||
|
||||
async function clickTakeSig() {
|
||||
takeSigBtn.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
// Flush the fetch .then() so _startWaitNoGlow() is called
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
it("adds .btn-cancel after the first pulse tick (600 ms)", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601);
|
||||
expect(takeSigBtn.classList.contains("btn-cancel")).toBe(true);
|
||||
});
|
||||
|
||||
it("sets a non-empty box-shadow after the first pulse tick", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601);
|
||||
expect(takeSigBtn.style.boxShadow).not.toBe("");
|
||||
});
|
||||
|
||||
it("removes .btn-cancel on the second tick (even / trough)", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601); // peak
|
||||
jasmine.clock().tick(600); // trough
|
||||
expect(takeSigBtn.classList.contains("btn-cancel")).toBe(false);
|
||||
});
|
||||
|
||||
it("clears box-shadow on the trough tick", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601);
|
||||
jasmine.clock().tick(600);
|
||||
expect(takeSigBtn.style.boxShadow).toBe("");
|
||||
});
|
||||
|
||||
it("stops glow and removes .btn-cancel when WAIT NVM is clicked (unready)", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601); // glow is on
|
||||
expect(takeSigBtn.classList.contains("btn-cancel")).toBe(true);
|
||||
|
||||
// Click again → WAIT NVM → fetch unready → _stopWaitNoGlow()
|
||||
takeSigBtn.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
await Promise.resolve();
|
||||
|
||||
expect(takeSigBtn.classList.contains("btn-cancel")).toBe(false);
|
||||
expect(takeSigBtn.style.boxShadow).toBe("");
|
||||
});
|
||||
|
||||
it("glow does not advance after being stopped", async () => {
|
||||
await clickTakeSig();
|
||||
jasmine.clock().tick(601); // peak
|
||||
takeSigBtn.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
await Promise.resolve(); // stop
|
||||
jasmine.clock().tick(600); // would be another tick if running
|
||||
expect(takeSigBtn.classList.contains("btn-cancel")).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user