feat(editor): sheet landings, history and e2e for the finding layers
« Tout afficher » clears the search and keeps the sort. A landing waits for the dialogs a move closed and for their focus restore. Helpers and shell specs move to the dialog and sheet flow; new finding dialog spec (entries, guards, flip, gone rule, Back and Forward over the layers).
This commit is contained in:
1 parent
18085cecf8
commit
4731a3376a
21 files changed
+782
-474
No files matched your search
@@ -167,8 +167,11 @@ describe('focus requests', () => {
|
||||
focus={request({ kind: 'reference', id: 'ref-a' })}
|
||||
/>,
|
||||
)
|
||||
expect(document.activeElement?.getAttribute('data-focus-key')).toContain(
|
||||
'ref-a',
|
||||
// The landing waits for any dialog a move closed: one microtask when none is open.
|
||||
await waitFor(() =>
|
||||
expect(document.activeElement?.getAttribute('data-focus-key')).toContain(
|
||||
'ref-a',
|
||||
),
|
||||
)
|
||||
cleanup()
|
||||
render(
|
||||
@@ -434,8 +437,10 @@ describe('a consumed request', () => {
|
||||
await openReady({ text })
|
||||
const user = userEvent.setup()
|
||||
render(<Harness />)
|
||||
expect(document.activeElement?.getAttribute('data-focus-key')).toContain(
|
||||
'ref-a',
|
||||
await waitFor(() =>
|
||||
expect(document.activeElement?.getAttribute('data-focus-key')).toContain(
|
||||
'ref-a',
|
||||
),
|
||||
)
|
||||
await user.click(screen.getByText('switch'))
|
||||
await user.click(screen.getByText('switch'))
|
||||
|
||||
@@ -421,7 +421,7 @@ describe('the exit', () => {
|
||||
})
|
||||
|
||||
describe('the library and the history around the panel', () => {
|
||||
it('« Tout afficher » resets the search and the sort of the tab, open tiles kept (P4)', async () => {
|
||||
it('« Tout afficher » clears the search of the tab and keeps its sort, open tiles kept (P4)', async () => {
|
||||
const user = await mount()
|
||||
await user.click(screen.getByRole('tab', { name: 'Références' }))
|
||||
const tab = () => screen.getByRole('tabpanel', { name: 'Références' })
|
||||
@@ -435,7 +435,7 @@ describe('the library and the history around the panel', () => {
|
||||
await user.click(link())
|
||||
await closed()
|
||||
expect(within(tab()).getByRole('searchbox')).toHaveValue('')
|
||||
expect(within(tab()).getByLabelText('Trier par')).toHaveValue('sheet')
|
||||
expect(within(tab()).getByLabelText('Trier par')).toHaveValue('citation')
|
||||
expect(within(tab()).getAllByRole('listitem').length).toBeGreaterThan(2)
|
||||
expect(
|
||||
within(tab()).getByRole('button', { name: /^Barone/ }),
|
||||
|
||||
@@ -584,7 +584,7 @@ describe('adding (P24)', () => {
|
||||
})
|
||||
|
||||
describe('the reset path (« Tout afficher »)', () => {
|
||||
it('empties the search and the sort, keeping open tiles and the tile in edit', async () => {
|
||||
it('empties the search and keeps the sort, keeping open tiles and the tile in edit (R2F-4)', async () => {
|
||||
await openReady({ text: sortText() })
|
||||
const user = userEvent.setup()
|
||||
const view = render(lib(false, { libraryReset: 0 }))
|
||||
@@ -594,7 +594,7 @@ describe('the reset path (« Tout afficher »)', () => {
|
||||
await user.type(search(), 'e')
|
||||
view.rerender(lib(false, { libraryReset: 1 }))
|
||||
expect(search()).toHaveValue('')
|
||||
expect(sortBox()).toHaveValue('sheet')
|
||||
expect(sortBox()).toHaveValue('citation')
|
||||
expect(order()).toHaveLength(5)
|
||||
expect(header('r2')).toHaveAttribute('aria-expanded', 'true')
|
||||
expect(within(item).getByLabelText('Citation')).toBeInTheDocument()
|
||||
|
||||
Reference in new issue
Block a user