From bbcfa35ff9e801c99ab2f03414c0fb6c5cb85b5c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 12 Aug 2026 22:10:48 -0700 Subject: [PATCH] test(mobile): avoid unresolved renderer test type --- .../agent-monitoring-indicators.test.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mobile/src/components/agent-monitoring-indicators.test.ts b/mobile/src/components/agent-monitoring-indicators.test.ts index c556a14fbaa..749d2636b98 100644 --- a/mobile/src/components/agent-monitoring-indicators.test.ts +++ b/mobile/src/components/agent-monitoring-indicators.test.ts @@ -1,11 +1,18 @@ import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { act, create } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { AgentSpinner } from './AgentSpinner' import { AgentStateDot } from './AgentStateDot' const DESKTOP_WORKING_COLOR = '#eab308' +type MonitoringTestRenderer = { + readonly root: { + findByType(type: string): { props: Record } + } + unmount(): void +} + const { animationLoop, animationTiming, setValue } = vi.hoisted(() => ({ animationLoop: vi.fn(() => ({ start: vi.fn(), stop: vi.fn() })), animationTiming: vi.fn(() => ({})), @@ -28,7 +35,7 @@ vi.mock('react-native', () => ({ })) describe('mobile monitoring indicators', () => { - let renderer: ReactTestRenderer | null = null + let renderer: MonitoringTestRenderer | null = null beforeEach(() => { animationLoop.mockClear() @@ -46,7 +53,7 @@ describe('mobile monitoring indicators', () => { renderer = create(createElement(AgentStateDot, { state: 'monitoring' })) }) - expect(renderer.root.findByType('Radio').props).toMatchObject({ + expect(renderer?.root.findByType('Radio').props).toMatchObject({ color: DESKTOP_WORKING_COLOR, size: 10 }) @@ -61,7 +68,7 @@ describe('mobile monitoring indicators', () => { ) }) - expect(renderer.root.findByType('Radio').props).toMatchObject({ + expect(renderer?.root.findByType('Radio').props).toMatchObject({ color: DESKTOP_WORKING_COLOR, size: 12 })