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,39 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import AnatomyCanvas from '@/components/canvas/AnatomyCanvas'
|
||||
|
||||
vi.mock('@/anatomy/svgLoader', () => ({
|
||||
loadSvg: vi.fn(async () => {
|
||||
const doc = new DOMParser().parseFromString(
|
||||
`<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<circle data-anno-id="epaule" data-anno-name-fr="Épaule" data-anno-name-en="Shoulder"
|
||||
data-anno-category="articulation" class="bone osteo articulation hitbox bone-epaule" />
|
||||
<circle data-anno-id="epaule" data-anno-name-fr="Épaule" data-anno-name-en="Shoulder"
|
||||
data-anno-category="articulation" class="bone osteo articulation visible bone-epaule" />
|
||||
</svg>`,
|
||||
'image/svg+xml',
|
||||
)
|
||||
return doc.documentElement as unknown as SVGSVGElement
|
||||
}),
|
||||
}))
|
||||
|
||||
beforeEach(() => vi.clearAllMocks())
|
||||
|
||||
describe('AnatomyCanvas', () => {
|
||||
it('renders the loaded SVG inline', async () => {
|
||||
render(<AnatomyCanvas src="/x.svg" boneStates={new Map()} onZoneClick={() => {}} />)
|
||||
await waitFor(() =>
|
||||
expect(document.querySelector('[data-anno-id="epaule"]')).not.toBeNull(),
|
||||
)
|
||||
})
|
||||
|
||||
it('calls onZoneClick with the clicked bone id', async () => {
|
||||
const onZoneClick = vi.fn()
|
||||
render(<AnatomyCanvas src="/x.svg" boneStates={new Map()} onZoneClick={onZoneClick} />)
|
||||
await waitFor(() => screen.getByTestId('anatomy-canvas'))
|
||||
;(document.querySelector('[data-anno-id="epaule"]') as Element).dispatchEvent(
|
||||
new Event('click', { bubbles: true }),
|
||||
)
|
||||
await waitFor(() => expect(onZoneClick).toHaveBeenCalledWith('epaule'))
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user