Fix relay settings component test isolation

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-07-13 04:52:39 -04:00
co-authored by Orca
parent e212216568
commit b54fdbc5e5
2 changed files with 7 additions and 3 deletions
@@ -19,10 +19,14 @@ const mocks = vi.hoisted(() => ({
state: {} as MobileRelayStoreState
}))
vi.mock('@/store', () => ({
vi.mock('../../store', () => ({
useAppStore: (selector: (state: MobileRelayStoreState) => unknown) => selector(mocks.state)
}))
vi.mock('../../i18n/i18n', () => ({
translate: (_key: string, fallback: string) => fallback
}))
describe('MobileRelayStatusSection', () => {
let statusListener: ((status: MobileRelayStatus) => void) | null
const connect = vi.fn().mockResolvedValue(null)
@@ -2,8 +2,8 @@ import { useEffect, useState } from 'react'
import { Loader2 } from 'lucide-react'
import { Badge } from '../ui/badge'
import { Button } from '../ui/button'
import { translate } from '@/i18n/i18n'
import { useAppStore } from '@/store'
import { translate } from '../../i18n/i18n'
import { useAppStore } from '../../store'
import type { MobileRelayStatus } from '../../../../shared/mobile-relay-status'
function relayStatusLabel(status: MobileRelayStatus): string {