mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 08:03:37 +00:00
Fix relay settings component test isolation
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user