tests.RenderedApp
The app a render put on the headless screen.
Utilisation
Observe system display settings.
Ce type est utilisé par 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;
}Déclaration du type
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>;
}Membres 11
| Nom | Type | Requis | Description |
|---|---|---|---|
tree | () => string | Oui | Every view, one line each in id order, as a device describes its tree. |
mutationslecture seule | readonly Mutation[] | Oui | The mutations the kernel's batches carried since this render, in order. |
callslecture seule | readonly ModuleCall[] | Oui | The native module calls the app made, in order. |
logslecture seule | readonly LogEntry[] | Oui | What the app and the runtime logged. |
emit | (module: string, name: string, value?: unknown) => Promise<void> | Oui | Sends a native module's event or live value change, as the platform does. |
getByText | (text: TextMatch) => TestView | Oui | The one view showing text; throws when none or several do. |
getAllByText | (text: TextMatch) => TestView[] | Oui | — |
queryByText | (text: TextMatch) => TestView | null | Oui | — |
getByRole | (role: string, options?: RoleOptions) => TestView | Oui | The one view with role (and name, when given); throws when none or several have it. |
getAllByRole | (role: string, options?: RoleOptions) => TestView[] | Oui | — |
queryByRole | (role: string, options?: RoleOptions) => TestView | null | Oui | — |
tree — signatures de méthode
Signatures
(): stringParamètres
Aucun paramètre.
Retourne
string
emit — signatures de méthode
Signatures
(module: string, name: string, value?: unknown): Promise<void>Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
module | string | Oui | — |
name | string | Oui | — |
value | unknown | Non | — |
Retourne
Promise<void>
getByText — signatures de méthode
Signatures
(text: TextMatch): TestViewParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
text | TextMatch | Oui | — |
Retourne
TestView
getAllByText — signatures de méthode
Signatures
(text: TextMatch): TestView[]Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
text | TextMatch | Oui | — |
Retourne
TestView[]
queryByText — signatures de méthode
Signatures
(text: TextMatch): TestView | nullParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
text | TextMatch | Oui | — |
Retourne
TestView
getByRole — signatures de méthode
Signatures
(role: string, options?: RoleOptions): TestViewParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
role | string | Oui | — |
options | RoleOptions | Non | — |
Retourne
TestView
getAllByRole — signatures de méthode
Signatures
(role: string, options?: RoleOptions): TestView[]Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
role | string | Oui | — |
options | RoleOptions | Non | — |
Retourne
TestView[]
queryByRole — signatures de méthode
Signatures
(role: string, options?: RoleOptions): TestView | nullParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
role | string | Oui | — |
options | RoleOptions | Non | — |
Retourne
TestView
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.