Verwendung

Observe system display settings.

Dieser Typ wird verwendet von tests.render

tsx
// Observe system display settings.
import { appearance } from 'kuito';
import { render, test } from 'kuito/tests';

const dark: appearance.AppearancePreferences = { colorScheme: 'dark', fontScale: 1.3 };

test('the header reads in dark mode at a large text size', async () => {
  await render(<Header />, { modules: { Appearance: dark } });
});

function Header() {
  return null;
}

Typdeklaration

ts
export interface RenderedApp extends Queries {
  /** Every view, one line each in id order, as a device describes its tree. */
  tree(): string;
  /** The mutations the kernel's batches carried since this render, in order. */
  readonly mutations: readonly Mutation[];
  /** The native module calls the app made, in order. */
  readonly calls: readonly ModuleCall[];
  /** What the app and the runtime logged. */
  readonly logs: readonly LogEntry[];
  /** Sends a native module's event or live value change, as the platform does. */
  emit(module: string, name: string, value?: unknown): Promise<void>;
}

Mitglieder 11

NameTypErforderlichBeschreibung
tree() => stringJaEvery view, one line each in id order, as a device describes its tree.
mutationsschreibgeschütztreadonly Mutation[]JaThe mutations the kernel's batches carried since this render, in order.
callsschreibgeschütztreadonly ModuleCall[]JaThe native module calls the app made, in order.
logsschreibgeschütztreadonly LogEntry[]JaWhat the app and the runtime logged.
emit(module: string, name: string, value?: unknown) => Promise<void>JaSends a native module's event or live value change, as the platform does.
getByText(text: TextMatch) => TestViewJaThe one view showing text; throws when none or several do.
getAllByText(text: TextMatch) => TestView[]Ja—
queryByText(text: TextMatch) => TestView | nullJa—
getByRole(role: string, options?: RoleOptions) => TestViewJaThe one view with role (and name, when given); throws when none or several have it.
getAllByRole(role: string, options?: RoleOptions) => TestView[]Ja—
queryByRole(role: string, options?: RoleOptions) => TestView | nullJa—
tree — Methodensignaturen

Signaturen

ts
(): string

Parameter

Keine Parameter.

Rückgabe

string

emit — Methodensignaturen

Signaturen

ts
(module: string, name: string, value?: unknown): Promise<void>

Parameter

NameTypErforderlichBeschreibung
modulestringJa—
namestringJa—
valueunknownNein—

Rückgabe

Promise<void>

getByText — Methodensignaturen

Signaturen

ts
(text: TextMatch): TestView

Parameter

NameTypErforderlichBeschreibung
textTextMatchJa—

Rückgabe

TestView

getAllByText — Methodensignaturen

Signaturen

ts
(text: TextMatch): TestView[]

Parameter

NameTypErforderlichBeschreibung
textTextMatchJa—

Rückgabe

TestView[]

queryByText — Methodensignaturen

Signaturen

ts
(text: TextMatch): TestView | null

Parameter

NameTypErforderlichBeschreibung
textTextMatchJa—

Rückgabe

TestView

getByRole — Methodensignaturen

Signaturen

ts
(role: string, options?: RoleOptions): TestView

Parameter

NameTypErforderlichBeschreibung
rolestringJa—
optionsRoleOptionsNein—

Rückgabe

TestView

getAllByRole — Methodensignaturen

Signaturen

ts
(role: string, options?: RoleOptions): TestView[]

Parameter

NameTypErforderlichBeschreibung
rolestringJa—
optionsRoleOptionsNein—

Rückgabe

TestView[]

queryByRole — Methodensignaturen

Signaturen

ts
(role: string, options?: RoleOptions): TestView | null

Parameter

NameTypErforderlichBeschreibung
rolestringJa—
optionsRoleOptionsNein—

Rückgabe

TestView

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.