Search (citation, DOI, URL) with « Effacer la recherche » and Escape;
« Trier par » sheet order, citation (locale collator), citation count,
type (business order); every sort stable on stored order, display only:
document, stored order, ids and history unchanged (unit + e2e). Count
« {n} références » / « {n} sur {total} » counts matching references
only. « Monter » / « Descendre » only in sheet order without search
(A1). « Ajouter une référence » resets search and sort and appends a
draft tile in edit; a tile in edit stays pinned while sorted or
searched; tile state pruned of absent ids. Reset path ready for « Tout
afficher » (R2.4).
Gates: typecheck, lint, test:run (app 1452), build, e2e:ui 251;
e2e:shell 16 specs on db:sandbox (editor-equine never listed): 115
passed / 102 skipped / 2 failed: editor-structures (test-side, fixed,
rerun with editor-references 12 passed / 11 skipped) and admin.spec A0
« Target crashed » during axe on the rights screen (not R2: that
screen renders every grant, 1 282 accumulated e2e fixtures; reported as
an open risk); full-row guard: no pre-existing row changed in any table.
## R-24 (removed or rewritten assertions)
| file | old | new |
|---|---|---|
| editor-references-tab.test.tsx | `#tab-reference-new-citation` present on load | null until « Ajouter une référence » |
| same | no match text « Aucune référence ne correspond. » | notice « Aucune référence ne contient « zzz ». » |
| same | add: form always visible, add clears the search, `getByText('Nouvelle source')` | click « Ajouter une référence » first; new tile header open, focused, search empty, 4 tiles |
| same | « a refused add keeps the search » | REMOVED (P24: add resets the search at once); replaced by « draft opens with citation focused, refused add keeps the draft, no write » |
| editor-tabs-lists.test.tsx | add form directly | click « Ajouter une référence » before the form assertions (same assertions after) |
| editor-keep-alive.test.tsx | form survives tab round trip | same, after opening the draft |
| editor-no-loss.test.tsx | reference form keeps typed text | same, after opening the draft |
| e2e editor-shell.spec (2), editor-shell-crossing.spec, editor-structures.spec | fill `#tab-reference-new-*` directly; `getByText(citation)` visible | open the draft first; structures asserts the new header is focused |
| e2e editor-references.spec keyboard walk | focus search, Tab reaches header 0 | focus « Ajouter une référence » (search, sort, add precede the headers) |
Other readers of `editor.reference.add`/new ids: grep of src, tests, e2e incl. editor-equine found none left unlisted. editor-equine is not affected ("updated, not run": nothing to update).
## i18n (fr / en)
Added: `editor.references.add` Ajouter une référence / Add a reference; `add_help` Type et citation obligatoires. / Type and citation required.; `clear_search` Effacer la recherche / Clear the search; `sort_by` Trier par / Sort by; `sort.sheet|citation|count|type` Ordre de la fiche, Citation (A → Z), Nombre de citations, Type / Sheet order, Citation (A → Z), Number of citations, Type; `count_one|other` {count} référence(s) / reference(s); `count_of_one|other` {count} référence(s) sur {total} / {count} reference(s) of {total}; `reorder_hint` Pour réorganiser, affichez l'ordre de la fiche sans recherche. / To reorder, show the sheet order without a search.; `no_result` Aucune référence ne contient « {q} ». / No reference contains “{q}”.; `no_result_scope` La recherche porte sur la citation, le DOI et l'URL. / The search covers the citation, the DOI and the URL. (REVUE sentence split in two keys so the first half is bold).
Changed: none. Removed: none (`editor.references.no_match` kept, the panel's EmptyLine still uses it).
507 lines
18 KiB
TypeScript
507 lines
18 KiB
TypeScript
import { fr } from '@/i18n/fr'
|
|
import type { Locator, Page, TestInfo } from '@playwright/test'
|
|
import {
|
|
expect,
|
|
expectAccessible,
|
|
expectNoHorizontalOverflow,
|
|
test,
|
|
} from '../support/browser'
|
|
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
|
|
import {
|
|
editorActor,
|
|
libraryRoot,
|
|
openEditor,
|
|
openTab,
|
|
place,
|
|
saveDraft,
|
|
seedDraft,
|
|
serverDocument,
|
|
serverRevision,
|
|
standardShape,
|
|
} from '../support/editor'
|
|
|
|
// V1-2.6 R2.2: the collapsible reference tiles of the Références tab (boards 23, 24, 27):
|
|
// closed, open and edit states with axe on each, the keyboard walk through the tile
|
|
// headers, the leave guard of the edit view, and the read-only twin at 375 px. The spec
|
|
// seeds its own sheet and never touches another.
|
|
|
|
const dict = fr
|
|
|
|
const isPhone = (info: TestInfo) => info.project.name === 'chromium-375'
|
|
const DOI = '10.3389/fvets.2022.898096'
|
|
|
|
/** « Référence A » (cited by « Constat A ») plus one cited by a family and one uncited. */
|
|
function shape(document: Record<string, unknown>) {
|
|
standardShape(document)
|
|
document.references = [
|
|
{
|
|
id: 'ref-a',
|
|
type: 'book',
|
|
citation: 'Référence A',
|
|
url: null,
|
|
doi: null,
|
|
},
|
|
{
|
|
id: 'ref-doi',
|
|
type: 'journal',
|
|
citation:
|
|
'Long-term outcome of horses undergoing surgery, Front Vet Sci 2022',
|
|
url: `https://doi.org/${DOI}`,
|
|
doi: DOI,
|
|
},
|
|
{
|
|
id: 'ref-free',
|
|
type: 'web',
|
|
citation: 'Source libre',
|
|
url: null,
|
|
doi: null,
|
|
},
|
|
]
|
|
const zone = (document.finding_zones as { categories: unknown[] }[])[0]
|
|
const family = zone.categories[0] as { reference_ids: string[] }
|
|
family.reference_ids = ['ref-doi']
|
|
}
|
|
|
|
async function open(page: Page, seedShape = shape) {
|
|
const actor = await editorActor('fr')
|
|
const seed = await seedDraft(actor, { shape: seedShape })
|
|
await openEditor(page, dict, actor, seed.sheetId)
|
|
return { actor, seed }
|
|
}
|
|
|
|
const headers = (page: Page) =>
|
|
libraryRoot(page).locator('button[aria-controls][id$="-header"]')
|
|
/** The tile at a position of the seeded list (header ids stay put while it is in edit). */
|
|
const tileAt = (page: Page, position: number): Locator =>
|
|
headers(page).nth(position).locator('xpath=ancestor::li[1]')
|
|
const REF_DOI = 1
|
|
const REF_A = 0
|
|
const REF_FREE = 2
|
|
|
|
test.describe('reference tiles, edit mode', () => {
|
|
test.use({ locale: 'fr-FR', actionTimeout: 15_000 })
|
|
test.beforeEach(async ({ context }, info) => {
|
|
test.skip(
|
|
isPhone(info),
|
|
'editing needs >= 1 024 px; the phone twin is below',
|
|
) // floor-guard: allow C16 editing needs >= 1024 px; read-only twin in this file
|
|
await routeToSandbox(context)
|
|
})
|
|
test.afterEach(async ({ context }) => {
|
|
await dropLateReplays(context)
|
|
})
|
|
|
|
test('closed, open and edit tiles, accessible in each state', async ({
|
|
page,
|
|
requests,
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
const { actor } = await open(page)
|
|
requests.forbid(actor.account.email, actor.account.password)
|
|
await openTab(page, dict, 'references')
|
|
await expect(headers(page)).toHaveCount(3)
|
|
await expect(headers(page).first()).toHaveAttribute(
|
|
'aria-expanded',
|
|
'false',
|
|
)
|
|
await expect(
|
|
libraryRoot(page).getByText(dict['editor.references.uncited']),
|
|
).toHaveCount(1)
|
|
await expectNoHorizontalOverflow(page, 'the closed tiles')
|
|
await expectAccessible(page, 'the closed reference tiles')
|
|
|
|
// Open: facts as safe links, the citers, the hint on a cited reference.
|
|
await headers(page).nth(1).click()
|
|
const cited = tileAt(page, REF_DOI)
|
|
await expect(headers(page).nth(1)).toHaveAttribute('aria-expanded', 'true')
|
|
const doi = cited
|
|
.getByRole('link', { name: new RegExp(DOI.replace('.', '\\.')) })
|
|
.first()
|
|
await expect(doi).toHaveAttribute('href', `https://doi.org/${DOI}`)
|
|
await expect(doi).toHaveAttribute('target', '_blank')
|
|
await expect(doi).toHaveAttribute('rel', 'noopener noreferrer')
|
|
await expect(cited.getByText('Dysfonction A')).toBeVisible()
|
|
await expect(
|
|
cited.getByText(dict['editor.references.family'], { exact: true }),
|
|
).toBeVisible()
|
|
await expect(
|
|
cited.getByRole('button', { name: dict['editor.action.delete'] }),
|
|
).toHaveCount(0)
|
|
await expect(
|
|
cited.getByText(dict['editor.references.delete_hint']),
|
|
).toBeVisible()
|
|
await headers(page).nth(2).click()
|
|
await expect(
|
|
tileAt(page, REF_FREE).getByRole('button', {
|
|
name: dict['editor.action.delete'],
|
|
}),
|
|
).toBeVisible()
|
|
await expectAccessible(page, 'the open reference tiles')
|
|
|
|
// Edit: the title, the focused citation, « Terminer » only.
|
|
await cited
|
|
.getByRole('button', { name: dict['editor.references.edit'] })
|
|
.click()
|
|
await expect(
|
|
cited.getByText(dict['editor.references.edit_title']),
|
|
).toBeVisible()
|
|
await expect(
|
|
cited.getByLabel(dict['editor.reference.citation']),
|
|
).toBeFocused()
|
|
await expect(
|
|
cited.getByRole('button', { name: dict['editor.action.move_up'] }),
|
|
).toHaveCount(0)
|
|
await expectAccessible(page, 'a reference tile in edit')
|
|
})
|
|
|
|
test('« Terminer » keeps the edit view while a field is refused', async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
await open(page)
|
|
await openTab(page, dict, 'references')
|
|
await headers(page).nth(2).click()
|
|
const tile = tileAt(page, REF_FREE)
|
|
await tile
|
|
.getByRole('button', { name: dict['editor.references.edit'] })
|
|
.click()
|
|
const url = tile.getByLabel(dict['editor.reference.url'])
|
|
await url.fill('exemple.org')
|
|
await tile
|
|
.getByRole('button', { name: dict['editor.references.done'] })
|
|
.click()
|
|
await expect(url).toBeFocused()
|
|
await expect(
|
|
tile.getByRole('button', { name: dict['editor.references.done'] }),
|
|
).toBeVisible()
|
|
await url.fill('https://exemple.org/page')
|
|
await tile
|
|
.getByRole('button', { name: dict['editor.references.done'] })
|
|
.click()
|
|
await expect(tile.getByLabel(dict['editor.reference.url'])).toHaveCount(0)
|
|
await expect(
|
|
tile.getByRole('link', { name: /exemple\.org/ }),
|
|
).toHaveAttribute('href', 'https://exemple.org/page')
|
|
})
|
|
|
|
test('the tile headers are a keyboard walk: Tab between them, Enter and Space open', async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
await open(page)
|
|
await openTab(page, dict, 'references')
|
|
// The toolbar's last stop (search, sort, add) precedes the first header.
|
|
await page
|
|
.getByRole('button', { name: dict['editor.references.add'] })
|
|
.focus()
|
|
for (let at = 0; at < 3; at++) {
|
|
await page.keyboard.press('Tab')
|
|
await expect(headers(page).nth(at)).toBeFocused()
|
|
}
|
|
// Focus is on the third header: one Shift+Tab back reaches the second.
|
|
await page.keyboard.press('Shift+Tab')
|
|
await expect(headers(page).nth(1)).toBeFocused()
|
|
await page.keyboard.press('Enter')
|
|
await expect(headers(page).nth(1)).toHaveAttribute('aria-expanded', 'true')
|
|
// Open, the tile's own content is the next tab stop: its DOI link, then back.
|
|
await page.keyboard.press('Tab')
|
|
await expect(tileAt(page, REF_DOI).getByRole('link').first()).toBeFocused()
|
|
await page.keyboard.press('Shift+Tab')
|
|
await expect(headers(page).nth(1)).toBeFocused()
|
|
await page.keyboard.press('Space')
|
|
await expect(headers(page).nth(1)).toHaveAttribute('aria-expanded', 'false')
|
|
})
|
|
|
|
test('« Aller à » on a citer opens the Constats tab on it', async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
await open(page)
|
|
await openTab(page, dict, 'references')
|
|
await headers(page).nth(0).click()
|
|
await tileAt(page, REF_A)
|
|
.getByRole('button', { name: dict['editor.references.go_to'] })
|
|
.click()
|
|
await expect(place(page, 'findings')).toBeVisible()
|
|
await expect(place(page, 'findings').locator(':focus')).toHaveCount(1)
|
|
})
|
|
})
|
|
|
|
/**
|
|
* Four references with distinct orders. Stored: Zèbre 10, zebre 9, Alpha, Étude.
|
|
* Citation A → Z: Alpha, Étude, zebre 9, Zèbre 10. Citations: zebre 9 two (family and
|
|
* node), Alpha one, the others none. Types: book, journal, legal, web.
|
|
*/
|
|
function sortShape(document: Record<string, unknown>) {
|
|
standardShape(document)
|
|
const reference = (id: string, type: string, citation: string) => ({
|
|
id,
|
|
type,
|
|
citation,
|
|
url: null,
|
|
doi: null,
|
|
})
|
|
document.references = [
|
|
reference('ref-z', 'web', 'Zèbre 10'),
|
|
reference('ref-y', 'journal', 'zebre 9'),
|
|
reference('ref-a', 'book', 'Alpha'),
|
|
reference('ref-e', 'legal', 'Étude'),
|
|
]
|
|
const zone = (document.finding_zones as { categories: unknown[] }[])[0]
|
|
const family = zone.categories[0] as {
|
|
reference_ids: string[]
|
|
children: { reference_ids: string[] }[]
|
|
}
|
|
family.reference_ids = ['ref-y']
|
|
family.children[0].reference_ids = ['ref-y', 'ref-a']
|
|
}
|
|
|
|
const SORTED = {
|
|
sheet: ['Zèbre 10', 'zebre 9', 'Alpha', 'Étude'],
|
|
citation: ['Alpha', 'Étude', 'zebre 9', 'Zèbre 10'],
|
|
count: ['zebre 9', 'Alpha', 'Zèbre 10', 'Étude'],
|
|
type: ['Alpha', 'zebre 9', 'Étude', 'Zèbre 10'],
|
|
} as const
|
|
|
|
/** The citations of the tiles in display order (the header's first text node). */
|
|
const shownCitations = (page: Page) =>
|
|
headers(page).evaluateAll((buttons) =>
|
|
buttons.map((button) => button.querySelector('span')?.textContent ?? ''),
|
|
)
|
|
|
|
test.describe('reference tiles, search, sort and add', () => {
|
|
test.use({ locale: 'fr-FR', actionTimeout: 15_000 })
|
|
test.beforeEach(async ({ context }, info) => {
|
|
test.skip(
|
|
isPhone(info),
|
|
'editing needs >= 1 024 px; the phone twin is below',
|
|
) // floor-guard: allow C16 editing needs >= 1024 px; read-only twin in this file
|
|
await routeToSandbox(context)
|
|
})
|
|
test.afterEach(async ({ context }) => {
|
|
await dropLateReplays(context)
|
|
})
|
|
|
|
const toolbar = (page: Page) => ({
|
|
search: libraryRoot(page).getByRole('searchbox', {
|
|
name: dict['editor.references.search'],
|
|
}),
|
|
sort: libraryRoot(page).getByLabel(dict['editor.references.sort_by']),
|
|
clear: libraryRoot(page).getByRole('button', {
|
|
name: dict['editor.references.clear_search'],
|
|
}),
|
|
})
|
|
|
|
test('four sorts, search, clear, no result, move buttons; the server never changes', async ({
|
|
page,
|
|
requests,
|
|
}) => {
|
|
test.setTimeout(150_000)
|
|
const { actor, seed } = await open(page, sortShape)
|
|
requests.forbid(actor.account.email, actor.account.password)
|
|
const before = await serverDocument(seed.draftId)
|
|
const revision = await serverRevision(seed.draftId)
|
|
await openTab(page, dict, 'references')
|
|
const bar = toolbar(page)
|
|
await expect(
|
|
libraryRoot(page).getByText('4 références', { exact: true }),
|
|
).toBeVisible()
|
|
for (const [sort, expected] of Object.entries(SORTED)) {
|
|
await bar.sort.selectOption(sort)
|
|
await expect.poll(() => shownCitations(page)).toEqual(expected)
|
|
}
|
|
await expectAccessible(page, 'the type sort')
|
|
|
|
// Search: count line, hint instead of the move buttons, clear, Escape.
|
|
await bar.sort.selectOption('sheet')
|
|
await headers(page).first().click()
|
|
const down = libraryRoot(page).getByRole('button', {
|
|
name: dict['editor.action.move_down'],
|
|
})
|
|
await expect(down).toBeVisible()
|
|
await bar.search.fill('zebre')
|
|
await expect(
|
|
libraryRoot(page).getByText('2 références sur 4', { exact: true }),
|
|
).toBeVisible()
|
|
await expect(down).toHaveCount(0)
|
|
await expect(
|
|
libraryRoot(page).getByText(dict['editor.references.reorder_hint']),
|
|
).toBeVisible()
|
|
await expectAccessible(page, 'a search in progress')
|
|
await bar.clear.click()
|
|
await expect(bar.search).toHaveValue('')
|
|
await expect(bar.search).toBeFocused()
|
|
await expect(down).toBeVisible()
|
|
await bar.search.fill('alpha')
|
|
await page.keyboard.press('Escape')
|
|
await expect(bar.search).toHaveValue('')
|
|
|
|
// No result, then the notice's own clear button.
|
|
await bar.search.fill('radiographie')
|
|
const notice = libraryRoot(page).getByRole('status').filter({
|
|
hasText: 'radiographie',
|
|
})
|
|
await expect(notice).toContainText('Aucune référence ne contient')
|
|
await expectAccessible(page, 'the no result notice')
|
|
await notice
|
|
.getByRole('button', { name: dict['editor.references.clear_search'] })
|
|
.click()
|
|
await expect(bar.search).toBeFocused()
|
|
await expect(headers(page)).toHaveCount(4)
|
|
|
|
// Display only: nothing was saved, the server holds the same document and revision.
|
|
expect(await serverDocument(seed.draftId)).toEqual(before)
|
|
expect(await serverRevision(seed.draftId)).toBe(revision)
|
|
})
|
|
|
|
test('add a reference, save it, then delete an uncited one', async ({
|
|
page,
|
|
requests,
|
|
}) => {
|
|
test.setTimeout(150_000)
|
|
const { actor, seed } = await open(page, sortShape)
|
|
requests.forbid(actor.account.email, actor.account.password)
|
|
await openTab(page, dict, 'references')
|
|
const bar = toolbar(page)
|
|
await bar.sort.selectOption('count')
|
|
await bar.search.fill('alpha')
|
|
await libraryRoot(page)
|
|
.getByRole('button', { name: dict['editor.references.add'] })
|
|
.click()
|
|
await expect(bar.search).toHaveValue('')
|
|
await expect(bar.sort).toHaveValue('sheet')
|
|
const citation = libraryRoot(page).getByLabel(
|
|
dict['editor.reference.citation'],
|
|
)
|
|
await expect(citation).toBeFocused()
|
|
// The focus scrolled the toolbar under the sticky header: axe judges what is covered.
|
|
await libraryRoot(page).getByRole('searchbox').scrollIntoViewIfNeeded()
|
|
await expectAccessible(page, 'the draft tile')
|
|
await libraryRoot(page)
|
|
.getByLabel(dict['editor.reference.type'])
|
|
.selectOption('manual')
|
|
await citation.fill('Nouvelle source')
|
|
await libraryRoot(page)
|
|
.getByRole('button', { name: dict['editor.reference.add'] })
|
|
.click()
|
|
await expect(headers(page)).toHaveCount(5)
|
|
const added = headers(page).last()
|
|
await expect(added).toContainText('Nouvelle source')
|
|
await expect(added).toHaveAttribute('aria-expanded', 'true')
|
|
await expect(added).toBeFocused()
|
|
await saveDraft(page, dict, seed.revision + 1)
|
|
const saved = await serverDocument<{ references: { citation: string }[] }>(
|
|
seed.draftId,
|
|
)
|
|
expect(saved.references.map((r) => r.citation)).toEqual([
|
|
...SORTED.sheet,
|
|
'Nouvelle source',
|
|
])
|
|
|
|
// Delete an uncited reference (Étude): the dialog confirms, the tile goes.
|
|
await headers(page).nth(3).click()
|
|
await tileAt(page, 3)
|
|
.getByRole('button', { name: dict['editor.action.delete'] })
|
|
.click()
|
|
await page
|
|
.getByRole('dialog')
|
|
.getByRole('button', { name: dict['editor.delete.confirm'] })
|
|
.click()
|
|
await expect(headers(page)).toHaveCount(4)
|
|
await expect(libraryRoot(page).getByText('Étude')).toHaveCount(0)
|
|
})
|
|
|
|
test('a tile in edit keeps its place under a sort and under a search', async ({
|
|
page,
|
|
requests,
|
|
}) => {
|
|
test.setTimeout(150_000)
|
|
const { actor } = await open(page, sortShape)
|
|
requests.forbid(actor.account.email, actor.account.password)
|
|
await openTab(page, dict, 'references')
|
|
const bar = toolbar(page)
|
|
await bar.sort.selectOption('citation')
|
|
await headers(page).nth(3).click()
|
|
await tileAt(page, 3)
|
|
.getByRole('button', { name: dict['editor.references.edit'] })
|
|
.click()
|
|
await bar.sort.selectOption('count')
|
|
await expect(
|
|
tileAt(page, 3).getByLabel(dict['editor.reference.citation']),
|
|
).toBeVisible()
|
|
await bar.search.fill('alpha')
|
|
await expect(headers(page)).toHaveCount(2)
|
|
await expect(
|
|
libraryRoot(page).getByLabel(dict['editor.reference.citation']),
|
|
).toBeVisible()
|
|
})
|
|
})
|
|
|
|
test.describe('reference tiles, read-only at 375 px', () => {
|
|
test.use({ locale: 'fr-FR', actionTimeout: 15_000 })
|
|
test.beforeEach(async ({ context }, info) => {
|
|
test.skip(!isPhone(info), 'the read-only twin runs at 375 px only')
|
|
await routeToSandbox(context)
|
|
})
|
|
test.afterEach(async ({ context }) => {
|
|
await dropLateReplays(context)
|
|
})
|
|
|
|
test('« Plus » lists Références; tiles keep DOI, URL and « Aller à », no edit control @phone', async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
await open(page)
|
|
await openTab(page, dict, 'references')
|
|
await expect(headers(page)).toHaveCount(3)
|
|
const box = await headers(page).first().boundingBox()
|
|
expect(box?.height ?? 0).toBeGreaterThanOrEqual(44)
|
|
// Board 27: search and sort are 44 px targets, there is no « Ajouter » and no hint.
|
|
const root = libraryRoot(page)
|
|
const search = root.getByRole('searchbox')
|
|
const sort = root.getByLabel(dict['editor.references.sort_by'])
|
|
for (const control of [search, sort]) {
|
|
expect((await control.boundingBox())?.height ?? 0).toBeGreaterThanOrEqual(
|
|
44,
|
|
)
|
|
}
|
|
await expect(
|
|
root.getByRole('button', { name: dict['editor.references.add'] }),
|
|
).toHaveCount(0)
|
|
await sort.selectOption('citation')
|
|
await search.fill('source')
|
|
await expect(headers(page)).toHaveCount(1)
|
|
await expect(
|
|
root.getByText(dict['editor.references.reorder_hint']),
|
|
).toHaveCount(0)
|
|
await root
|
|
.getByRole('button', { name: dict['editor.references.clear_search'] })
|
|
.click()
|
|
await sort.selectOption('sheet')
|
|
await expect(headers(page)).toHaveCount(3)
|
|
await expectNoHorizontalOverflow(page, 'the closed tiles at 375 px')
|
|
await expectAccessible(page, 'the closed tiles at 375 px')
|
|
await headers(page).nth(1).click()
|
|
const cited = tileAt(page, REF_DOI)
|
|
await expect(cited.getByRole('link').first()).toHaveAttribute(
|
|
'target',
|
|
'_blank',
|
|
)
|
|
const goTo = cited.getByRole('button', {
|
|
name: dict['editor.references.go_to'],
|
|
})
|
|
expect((await goTo.boundingBox())?.height ?? 0).toBeGreaterThanOrEqual(44)
|
|
for (const name of [
|
|
dict['editor.references.edit'],
|
|
dict['editor.action.delete'],
|
|
dict['editor.action.move_up'],
|
|
]) {
|
|
await expect(libraryRoot(page).getByRole('button', { name })).toHaveCount(
|
|
0,
|
|
)
|
|
}
|
|
await expectNoHorizontalOverflow(page, 'an open tile at 375 px')
|
|
await expectAccessible(page, 'an open tile at 375 px')
|
|
})
|
|
})
|