test(desktop): satisfy Translations typing and lint rules for office-open tests

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
m4
2026-09-17 23:08:24 +08:00
parent 45dc96b139
commit 526b13170d
2 changed files with 7 additions and 1 deletions
@@ -2,6 +2,8 @@ import { cleanup, fireEvent, render } from '@testing-library/react'
import type * as React from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type * as FileActions from '../file-actions'
const { openFileWithSystemApp } = vi.hoisted(() => ({ openFileWithSystemApp: vi.fn() }))
vi.mock('@/lib/office-files', () => ({
@@ -9,7 +11,7 @@ vi.mock('@/lib/office-files', () => ({
openFileWithSystemApp
}))
vi.mock('../file-actions', async importOriginal => {
const actual = await importOriginal<typeof import('../file-actions')>()
const actual = await importOriginal<typeof FileActions>()
return {
...actual,
@@ -40,6 +42,7 @@ function renderRow(id: string, isDirectory = false) {
onAttachFolder={vi.fn()}
onPreviewFile={onPreviewFile}
style={{}}
tree={{} as never}
/>
)
+3
View File
@@ -3288,6 +3288,9 @@ export interface Translations {
largeTitle: string
largeBody: (label: string, size: string) => string
previewAnyway: string
openWithSystemApp: string
systemOpenFailed: string
remoteTooLarge: string
truncated: string
noInlineTitle: string
noInlineBody: (mimeType: string) => string