mirror of
https://github.com/Smile-QWQ/SubTracker.git
synced 2026-09-03 06:23:58 +08:00
- add vue-i18n to the web app and load zh-CN and en-US strings from the shared message catalog - replace hardcoded UI copy across login, subscriptions, settings, calendar, statistics and supporting dialogs and utilities with translation keys - send locale headers with API requests, reuse localized message helpers and cover the localized web flows with regression tests
20 lines
832 B
TypeScript
20 lines
832 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { setAppLocale } from '@/locales'
|
|
import { getJsonImportWarningMessage, shouldRecommendDbImport } from '../../../src/utils/wallos-import'
|
|
|
|
describe('wallos import ui helpers', () => {
|
|
it('recommends db import for json file selection or json preview type', () => {
|
|
expect(shouldRecommendDbImport('subscriptions.json')).toBe(true)
|
|
expect(shouldRecommendDbImport('wallos.db')).toBe(false)
|
|
expect(shouldRecommendDbImport(null, 'json')).toBe(true)
|
|
expect(shouldRecommendDbImport('subscriptions.zip', 'db')).toBe(false)
|
|
})
|
|
|
|
it('provides a stable warning message', () => {
|
|
setAppLocale('zh-CN')
|
|
const message = getJsonImportWarningMessage()
|
|
expect(message).toContain('推荐优先使用 Wallos DB 导入')
|
|
expect(message).toContain('JSON')
|
|
})
|
|
})
|