tests.RenderedApp
The app a render put on the headless screen.
Verwendung
Observe system display settings.
Dieser Typ wird verwendet von tests.render
// 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
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
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
tree | () => string | Ja | Every view, one line each in id order, as a device describes its tree. |
mutationsschreibgeschützt | readonly Mutation[] | Ja | The mutations the kernel's batches carried since this render, in order. |
callsschreibgeschützt | readonly ModuleCall[] | Ja | The native module calls the app made, in order. |
logsschreibgeschützt | readonly LogEntry[] | Ja | What the app and the runtime logged. |
emit | (module: string, name: string, value?: unknown) => Promise<void> | Ja | Sends a native module's event or live value change, as the platform does. |
getByText | (text: TextMatch) => TestView | Ja | The one view showing text; throws when none or several do. |
getAllByText | (text: TextMatch) => TestView[] | Ja | — |
queryByText | (text: TextMatch) => TestView | null | Ja | — |
getByRole | (role: string, options?: RoleOptions) => TestView | Ja | The 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 | null | Ja | — |
tree — Methodensignaturen
Signaturen
(): stringParameter
Keine Parameter.
Rückgabe
string
emit — Methodensignaturen
Signaturen
(module: string, name: string, value?: unknown): Promise<void>Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
module | string | Ja | — |
name | string | Ja | — |
value | unknown | Nein | — |
Rückgabe
Promise<void>
getByText — Methodensignaturen
Signaturen
(text: TextMatch): TestViewParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
text | TextMatch | Ja | — |
Rückgabe
TestView
getAllByText — Methodensignaturen
Signaturen
(text: TextMatch): TestView[]Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
text | TextMatch | Ja | — |
Rückgabe
TestView[]
queryByText — Methodensignaturen
Signaturen
(text: TextMatch): TestView | nullParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
text | TextMatch | Ja | — |
Rückgabe
TestView
getByRole — Methodensignaturen
Signaturen
(role: string, options?: RoleOptions): TestViewParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
role | string | Ja | — |
options | RoleOptions | Nein | — |
Rückgabe
TestView
getAllByRole — Methodensignaturen
Signaturen
(role: string, options?: RoleOptions): TestView[]Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
role | string | Ja | — |
options | RoleOptions | Nein | — |
Rückgabe
TestView[]
queryByRole — Methodensignaturen
Signaturen
(role: string, options?: RoleOptions): TestView | nullParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
role | string | Ja | — |
options | RoleOptions | Nein | — |
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.