fix(13-02): resolve residual no-unnecessary-type-assertion in SyncStateToast.test
- Replace inline 'as string | null' assertion with an explicit typed const declaration inside the vi.hoisted() callback body - 'value: string | null' typed const satisfies both ESLint (no assertion) and tsc (null assignment on line 82 is type-safe)
This commit is contained in:
@@ -25,11 +25,15 @@ const {
|
|||||||
mockLastSyncedUid,
|
mockLastSyncedUid,
|
||||||
mockSetLastSyncedUid,
|
mockSetLastSyncedUid,
|
||||||
mockFetchSyncStatus,
|
mockFetchSyncStatus,
|
||||||
} = vi.hoisted(() => ({
|
} = vi.hoisted(() => {
|
||||||
mockLastSyncedUid: { value: 'test-uid-123' as string | null },
|
// Declare with explicit type so later null assignments (line 82+) stay type-safe
|
||||||
mockSetLastSyncedUid: vi.fn(),
|
const mockLastSyncedUid: { value: string | null } = { value: 'test-uid-123' }
|
||||||
mockFetchSyncStatus: vi.fn(),
|
return {
|
||||||
}))
|
mockLastSyncedUid,
|
||||||
|
mockSetLastSyncedUid: vi.fn(),
|
||||||
|
mockFetchSyncStatus: vi.fn(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
vi.mock('../store/calendarStore.js', () => ({
|
vi.mock('../store/calendarStore.js', () => ({
|
||||||
useCalendarStore: (selector: (s: Record<string, unknown>) => unknown) => {
|
useCalendarStore: (selector: (s: Record<string, unknown>) => unknown) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user