test(editor): fix typecheck of the history entry and dialog helpers
This commit is contained in:
1 parent
af300de04c
commit
e2d020bd3d
3 files changed
+6
-2
No files matched your search
@@ -89,7 +89,9 @@ test.describe('finding dialog', () => {
|
|||||||
rows: await rows(page).count(),
|
rows: await rows(page).count(),
|
||||||
y: await page.evaluate(() => window.scrollY),
|
y: await page.evaluate(() => window.scrollY),
|
||||||
}
|
}
|
||||||
await row.focus({ preventScroll: true })
|
await row.evaluate((element: HTMLElement) =>
|
||||||
|
element.focus({ preventScroll: true }),
|
||||||
|
)
|
||||||
await page.keyboard.press('Enter')
|
await page.keyboard.press('Enter')
|
||||||
await expect(dialog(page)).toBeVisible()
|
await expect(dialog(page)).toBeVisible()
|
||||||
await page.keyboard.press('Escape')
|
await page.keyboard.press('Escape')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { act, screen, waitFor, within } from '@testing-library/react'
|
import { act, screen, waitFor, within } from '@testing-library/react'
|
||||||
import type userEvent from '@testing-library/user-event'
|
import type userEvent from '@testing-library/user-event'
|
||||||
|
import { expect } from 'vitest'
|
||||||
|
|
||||||
type User = ReturnType<typeof userEvent.setup>
|
type User = ReturnType<typeof userEvent.setup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/** R2F-1: the history entry, its ownership, the write plan and the write budget. */
|
/** R2F-1: the history entry, its ownership, the write plan and the write budget. */
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import type { ElementKey } from '@faunosteo/core-wasm/types'
|
||||||
import {
|
import {
|
||||||
createWriteBudget,
|
createWriteBudget,
|
||||||
ENTRY_KEY,
|
ENTRY_KEY,
|
||||||
@@ -33,7 +34,7 @@ const entry = (patch: Partial<HistoryEntry> = {}): HistoryEntry => ({
|
|||||||
})
|
})
|
||||||
const stateOf = (value: unknown) => ({ [ENTRY_KEY]: value })
|
const stateOf = (value: unknown) => ({ [ENTRY_KEY]: value })
|
||||||
|
|
||||||
const node = { kind: 'finding', zone_id: 'z', path: ['f', 'n'] } as const
|
const node: ElementKey = { kind: 'finding', zone_id: 'z', path: ['f', 'n'] }
|
||||||
|
|
||||||
describe('sanitizeView', () => {
|
describe('sanitizeView', () => {
|
||||||
it('keeps a tab and a section, and drops a malformed layer', () => {
|
it('keeps a tab and a section, and drops a malformed layer', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user