diff --git a/src/app/features/hud/hud-dock.component.spec.ts b/src/app/features/hud/hud-dock.component.spec.ts index 1e43963..8fdf075 100644 --- a/src/app/features/hud/hud-dock.component.spec.ts +++ b/src/app/features/hud/hud-dock.component.spec.ts @@ -210,6 +210,21 @@ describe('HudDockComponent', () => { expect(host().querySelector('[aria-label="Forget Sirius"]')?.getAttribute('aria-pressed')).toBe('true'); }); + it('keeps the one system whose catalogue id is zero, which truthiness would have lost', () => { + // The Sun is star 0. A `@if (id; as ...)` reads that as "no star" and hides the control. + const bookmarks = TestBed.inject(BookmarksStore); + setReadout(); + fixture.componentRef.setInput('title', 'Sol'); + fixture.componentRef.setInput('keepableStarId', 0); + fixture.componentRef.setInput('defaultTab', 'readout'); + fixture.detectChanges(); + + host().querySelector('[aria-label="Keep Sol"]')?.click(); + fixture.detectChanges(); + + expect(bookmarks.has('star', 0)).toBe(true); + }); + it('offers nothing to keep where the readout is a scale rather than a place', () => { setReadout(); fixture.componentRef.setInput('defaultTab', 'readout'); diff --git a/src/app/features/hud/hud-dock.component.ts b/src/app/features/hud/hud-dock.component.ts index 2cfe244..6358467 100644 --- a/src/app/features/hud/hud-dock.component.ts +++ b/src/app/features/hud/hud-dock.component.ts @@ -91,16 +91,19 @@ function isWideViewport(): boolean {

{{ eyebrow() }}

{{ title() }}

- @if (keepableStarId(); as starId) { + + @if (keepableStarId() !== null) { }