chore(workspace): move the app to apps/app under a pnpm workspace (step 2)
144 files moved with git mv (pure renames). Root package.json delegates dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager, root devDependency, engine-strict). Dockerfile builds @faunosteo/app on node:24-alpine and copies apps/app/dist; nginx and runtime config unchanged. CI workflow for Gitea Actions. packages/ reserved (README only). Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan. 271/271 tests, typecheck, lint, build green from the root.
This commit is contained in:
1 parent
c8d48ab4cc
commit
8673475293
164 files changed
+348
-128
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
||||
import { renderHook, act } from '@testing-library/react'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
|
||||
beforeEach(() => {
|
||||
useLocaleStore.setState({ locale: 'fr' })
|
||||
})
|
||||
|
||||
describe('useT', () => {
|
||||
it('returns the FR value for a known key', () => {
|
||||
const { result } = renderHook(() => useT())
|
||||
expect(result.current('common.cancel')).toBe('Annuler')
|
||||
})
|
||||
|
||||
it('returns the EN value after switching locale', () => {
|
||||
const { result } = renderHook(() => useT())
|
||||
act(() => useLocaleStore.getState().setLocale('en'))
|
||||
expect(result.current('common.cancel')).toBe('Cancel')
|
||||
})
|
||||
|
||||
it('returns the key literal and warns when key is missing', () => {
|
||||
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
const { result } = renderHook(() => useT())
|
||||
expect(result.current('nonexistent.key')).toBe('nonexistent.key')
|
||||
expect(warn).toHaveBeenCalled()
|
||||
warn.mockRestore()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user