Usage

Observe system display settings.

This type is used by 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;
}

Type declaration

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

Members 11

NameTypeRequiredDescription
tree() => stringYesEvery view, one line each in id order, as a device describes its tree.
mutationsreadonlyreadonly Mutation[]YesThe mutations the kernel's batches carried since this render, in order.
callsreadonlyreadonly ModuleCall[]YesThe native module calls the app made, in order.
logsreadonlyreadonly LogEntry[]YesWhat the app and the runtime logged.
emit(module: string, name: string, value?: unknown) => Promise<void>YesSends a native module's event or live value change, as the platform does.
getByText(text: TextMatch) => TestViewYesThe one view showing text; throws when none or several do.
getAllByText(text: TextMatch) => TestView[]Yes—
queryByText(text: TextMatch) => TestView | nullYes—
getByRole(role: string, options?: RoleOptions) => TestViewYesThe one view with role (and name, when given); throws when none or several have it.
getAllByRole(role: string, options?: RoleOptions) => TestView[]Yes—
queryByRole(role: string, options?: RoleOptions) => TestView | nullYes—
tree — method signatures

Signatures

ts
(): string

Parameters

No parameters.

Returns

string

emit — method signatures

Signatures

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

Parameters

NameTypeRequiredDescription
modulestringYes—
namestringYes—
valueunknownNo—

Returns

Promise<void>

getByText — method signatures

Signatures

ts
(text: TextMatch): TestView

Parameters

NameTypeRequiredDescription
textTextMatchYes—

Returns

TestView

getAllByText — method signatures

Signatures

ts
(text: TextMatch): TestView[]

Parameters

NameTypeRequiredDescription
textTextMatchYes—

Returns

TestView[]

queryByText — method signatures

Signatures

ts
(text: TextMatch): TestView | null

Parameters

NameTypeRequiredDescription
textTextMatchYes—

Returns

TestView

getByRole — method signatures

Signatures

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

Parameters

NameTypeRequiredDescription
rolestringYes—
optionsRoleOptionsNo—

Returns

TestView

getAllByRole — method signatures

Signatures

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

Parameters

NameTypeRequiredDescription
rolestringYes—
optionsRoleOptionsNo—

Returns

TestView[]

queryByRole — method signatures

Signatures

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

Parameters

NameTypeRequiredDescription
rolestringYes—
optionsRoleOptionsNo—

Returns

TestView

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.