Utilização

Observe system display settings.

Este tipo é usado por 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;
}

Declaração do tipo

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>;
}

Membros 11

NomeTipoObrigatórioDescrição
tree() => stringSimEvery view, one line each in id order, as a device describes its tree.
mutationssó de leiturareadonly Mutation[]SimThe mutations the kernel's batches carried since this render, in order.
callssó de leiturareadonly ModuleCall[]SimThe native module calls the app made, in order.
logssó de leiturareadonly LogEntry[]SimWhat the app and the runtime logged.
emit(module: string, name: string, value?: unknown) => Promise<void>SimSends a native module's event or live value change, as the platform does.
getByText(text: TextMatch) => TestViewSimThe one view showing text; throws when none or several do.
getAllByText(text: TextMatch) => TestView[]Sim—
queryByText(text: TextMatch) => TestView | nullSim—
getByRole(role: string, options?: RoleOptions) => TestViewSimThe one view with role (and name, when given); throws when none or several have it.
getAllByRole(role: string, options?: RoleOptions) => TestView[]Sim—
queryByRole(role: string, options?: RoleOptions) => TestView | nullSim—
tree — assinaturas de método

Assinaturas

ts
(): string

Parâmetros

Sem parâmetros.

Devolve

string

emit — assinaturas de método

Assinaturas

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

Parâmetros

NomeTipoObrigatórioDescrição
modulestringSim—
namestringSim—
valueunknownNão—

Devolve

Promise<void>

getByText — assinaturas de método

Assinaturas

ts
(text: TextMatch): TestView

Parâmetros

NomeTipoObrigatórioDescrição
textTextMatchSim—

Devolve

TestView

getAllByText — assinaturas de método

Assinaturas

ts
(text: TextMatch): TestView[]

Parâmetros

NomeTipoObrigatórioDescrição
textTextMatchSim—

Devolve

TestView[]

queryByText — assinaturas de método

Assinaturas

ts
(text: TextMatch): TestView | null

Parâmetros

NomeTipoObrigatórioDescrição
textTextMatchSim—

Devolve

TestView

getByRole — assinaturas de método

Assinaturas

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

Parâmetros

NomeTipoObrigatórioDescrição
rolestringSim—
optionsRoleOptionsNão—

Devolve

TestView

getAllByRole — assinaturas de método

Assinaturas

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

Parâmetros

NomeTipoObrigatórioDescrição
rolestringSim—
optionsRoleOptionsNão—

Devolve

TestView[]

queryByRole — assinaturas de método

Assinaturas

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

Parâmetros

NomeTipoObrigatórioDescrição
rolestringSim—
optionsRoleOptionsNão—

Devolve

TestView

Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.