diff --git a/frontend/angular/src/app/features/player/player-shell.component.spec.ts b/frontend/angular/src/app/features/player/player-shell.component.spec.ts index 17c30f1..ed8b19a 100644 --- a/frontend/angular/src/app/features/player/player-shell.component.spec.ts +++ b/frontend/angular/src/app/features/player/player-shell.component.spec.ts @@ -1,5 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; +import lobbyCatalog from '../../../../../../shared/i18n/lobby.json'; import { PlayerShellComponent } from './player-shell.component'; type FetchMock = ReturnType; @@ -467,11 +468,27 @@ describe('PlayerShellComponent gameplay wiring', () => { component.ngOnDestroy(); }); - it('exposes i18n warning copy for phone-client audio policy', () => { + it('resolves i18n warning copy from shared catalog without key fallback', () => { const component = new PlayerShellComponent(); + const notice = component.copy('player.audio_policy_notice'); + const expected = lobbyCatalog.frontend.ui.player.audio_policy_notice[component.locale]; + + expect(notice).toBe(expected); + expect(notice).not.toBe('player.audio_policy_notice'); + }); + + it('gates template warning notice on the no-audio-output capability flag', () => { + const templateSource = String((PlayerShellComponent as any).ɵcmp?.template); + + expect(templateSource).toContain('clientHasNoAudioOutput'); + + const component = new PlayerShellComponent(); expect(component.copy('player.audio_policy_notice')).not.toBe('player.audio_policy_notice'); - expect(component.copy('player.audio_policy_notice')).toContain('Audio'); + expect(component.clientHasNoAudioOutput).toBe(true); + + (component as any).clientHasNoAudioOutput = false; + expect(component.clientHasNoAudioOutput).toBe(false); }); });