natus wheel: fix DON/DOFF reset on PRV/NXT return to DONned planet — TDD
_aspectsVisible was set to false when stepping away to a different planet, but the guard `if (item0.name !== _aspectPlanet)` only skipped resetting it on return — it never restored it to true. Replace the conditional with a direct assignment: _aspectsVisible = (item0.name === _aspectPlanet). T11g: navigating away via NXT then back via PRV restores DOFF-active state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -429,6 +429,26 @@ describe("NatusWheel — DON/DOFF aspect line persistence", () => {
|
||||
expect(donDisabled()).toBe(false);
|
||||
expect(aspectLines()).toBe(0);
|
||||
});
|
||||
|
||||
// T11g — PRV/NXT navigation back to a DONned planet must restore DOFF state
|
||||
it("T11g: navigating away via NXT then back via PRV restores DOFF-active state", () => {
|
||||
clickPlanet("Sun");
|
||||
clickDon();
|
||||
expect(donDisabled()).toBe(true); // DON disabled, aspects active
|
||||
|
||||
// Navigate away to next planet
|
||||
tooltipEl.querySelector(".nw-tt-nxt")
|
||||
.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
expect(donDisabled()).toBe(false); // new planet — DON fresh/active
|
||||
|
||||
// Navigate back to Sun
|
||||
tooltipEl.querySelector(".nw-tt-prv")
|
||||
.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
|
||||
// Sun's aspects are still drawn — DOFF must be active, DON must be disabled
|
||||
expect(donDisabled()).toBe(true);
|
||||
expect(aspectLines()).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
xdescribe("NatusWheel — half-wheel tooltip positioning", () => {
|
||||
|
||||
Reference in New Issue
Block a user