test(editor): reference dialog, filter and the owner journey, specs follow the dialog

This commit is contained in:
bchanot committed 2026-11-13 20:27:01 +01:00
1 parent 7a64daf251
commit 8b42816270
20 files changed
+1546 -1171

No files matched your search

@@ -13,13 +13,13 @@ import type {
AnatomicalSheetDocument,
ElementKey,
} from '@faunosteo/core-wasm/types'
import { findingLayerOf } from '@/editor/findingLayer'
import { findingLayerOf, referenceLayerOf } from '@/editor/findingLayer'
import { testLayer } from '../helpers/findingsHost'
import ReferencesHost from '../helpers/referencesHost'
import FindingsTab from '@/components/editor/tabs/FindingsTab'
import RegionsSection from '@/components/editor/annotations/sections/RegionsSection'
import EditorTabBody from '@/components/editor/EditorTabBody'
import EditorTabs from '@/components/editor/EditorTabs'
import ReferencesTab from '@/components/editor/tabs/ReferencesTab'
import AnnotationsTab from '@/components/editor/tabs/AnnotationsTab'
import {
FocusConsumedContext,
@@ -164,7 +164,7 @@ describe('focus requests', () => {
})
await openReady({ text })
render(
<ReferencesTab
<ReferencesHost
{...base}
focus={request({ kind: 'reference', id: 'ref-a' })}
/>,
@@ -200,9 +200,9 @@ describe('focus requests', () => {
})
await openReady({ text })
const focus = request({ kind: 'reference', id: 'ref-a' })
const view = render(<ReferencesTab {...base} focus={focus} />)
const view = render(<ReferencesHost {...base} focus={focus} />)
;(document.activeElement as HTMLElement).blur()
view.rerender(<ReferencesTab {...base} focus={focus} />)
view.rerender(<ReferencesHost {...base} focus={focus} />)
expect(document.activeElement?.getAttribute('data-focus-key')).toBeNull()
})
@@ -271,6 +271,7 @@ function Probe({ go, tier }: { go: EditorTarget; tier: 'wide' | 'small' }) {
{...base}
navigate={nav.navigate}
layer={findingLayerOf(nav)}
references={referenceLayerOf(nav)}
focus={state.focus}
annotations={{
section: state.section,
@@ -288,7 +289,17 @@ function ShowAllProbe() {
return (
<>
<EditorTabs active={nav.state.tab} tier="wide" onSelect={nav.selectTab} />
<button onClick={nav.showAllReferences}>show all</button>
<button
onClick={() =>
nav.showAllReferences({
kind: 'finding',
zone_id: 'zone-a',
path: ['fcat-a', 'fnode-a'],
})
}
>
show all
</button>
</>
)
}
@@ -419,7 +430,7 @@ function Harness() {
switch
</button>
{shown === 'references' ? (
<ReferencesTab {...base} focus={focus} />
<ReferencesHost {...base} focus={focus} />
) : (
<RegionsSection {...base} focus={focus} />
)}