On this page

What your app's own tests need. See Test an instance.

createTestJali

createJali, kept apart from the page and from other tests: its address in memory (location), storage in memory, a size of 1440 by 900 unless size says otherwise, keys as on a Mac, and no DOM focus moved. search opens it on a link. Its features are the ones you give, with the address always in memory.

createTestJali(options: TestJaliOptions): { jali: Jali; location: TestLocation }

testJaliOptions

The same options, for an app that makes its instance in a function of its own: pass options to it, and put your own features before its features ([...defaultFeatures(), ...(options.features ?? [])]), so its memory address takes the place of urlSync().

testJaliOptions(options?: { search?: string; size?: { width: number; height: number } }): { options: Partial<JaliOptions>; location: TestLocation }

reportUnsaved

What a rendered pane's useUnsaved reports: what is unsaved in pane, or nothing is (null).

reportUnsaved(jali: AnyJali, pane: string, what: string | null): ActionResult

reportPaneState

What a rendered pane's usePaneState keeps: value under key, for the object the pane shows.

reportPaneState(jali: AnyJali, pane: string, key: string, value: unknown): ActionResult

paneStateOf

A pane's own state, for the object it shows now.

paneStateOf(jali: AnyJali, pane: string): Record<string, unknown> | undefined

discardQuestion

"Discard unsaved changes?", while it is asked: the panes that would lose work.

discardQuestion(jali: AnyJali): { panes: readonly string[] } | null

answerDiscard

Answers the question as the person would: Discard makes the change it held, Keep editing doesn't.

answerDiscard(jali: AnyJali, answer: "discard" | "keep"): ActionResult

chooserRequest

What jali.dialogs.choose is asking the person now, or null. Choose by calling its onChoose.

chooserRequest(jali: AnyJali): ChooseOptions<unknown> | null

lastAnnouncement

The last thing the instance said to assistive technology.

lastAnnouncement(jali: AnyJali): string

TestJaliOptions

createTestJali's options: an instance's, and the link it opens on.

interface TestJaliOptions extends JaliOptions { search?: string }

TestLocation

An address in memory: entries lists every address written, and visit changes it as Back or a router link would.

type TestLocation = LocationPort & { entries: string[]; visit(search: string): void }