From 03e75e924c80c5ba3ec2f751d76848dba224886f Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 4 Aug 2026 02:59:09 -0700 Subject: [PATCH] test(mobile): pin the working row's live region across both states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deleting the prop, or the plausible-looking `stale ? 'polite' : 'none'`, both left every case green. The contract is that the mode is constant — Android drops the announcement if it is switched on in the same commit as the content change — so it has to be asserted in both renders. --- mobile/src/session/MobileAgentWorkingIndicator.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mobile/src/session/MobileAgentWorkingIndicator.test.ts b/mobile/src/session/MobileAgentWorkingIndicator.test.ts index 3b28bd159f9..1c4346818fc 100644 --- a/mobile/src/session/MobileAgentWorkingIndicator.test.ts +++ b/mobile/src/session/MobileAgentWorkingIndicator.test.ts @@ -69,12 +69,19 @@ describe('MobileAgentWorkingIndicator', () => { return renderer!.root.findAll((node) => node.type === 'AnimatedView').length } + function liveRegion(): unknown { + return renderer!.root.find((node) => node.type === 'View').props.accessibilityLiveRegion + } + it('animates a live working row', async () => { await render(false) expect(label()).toBe('Agent is working') expect(dots()).toBe(3) expect(mocks.start).toHaveBeenCalledTimes(3) + // Constant across both states by design: Android drops the announcement if + // the mode is switched on in the same commit as the content change. + expect(liveRegion()).toBe('polite') }) it('mutes the row and stops the animation while the status is stale', async () => { @@ -84,6 +91,7 @@ describe('MobileAgentWorkingIndicator', () => { // Dots are the "live activity" signal — they must not survive a disconnect. expect(dots()).toBe(0) expect(mocks.start).not.toHaveBeenCalled() + expect(liveRegion()).toBe('polite') }) it('stops the running animation when a live row goes stale', async () => {