tests.RenderedApp
The app a render put on the headless screen.
Utilização
Observe system display settings.
Este tipo é usado por 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;
}Declaração do tipo
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
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
tree | () => string | Sim | Every view, one line each in id order, as a device describes its tree. |
mutationssó de leitura | readonly Mutation[] | Sim | The mutations the kernel's batches carried since this render, in order. |
callssó de leitura | readonly ModuleCall[] | Sim | The native module calls the app made, in order. |
logssó de leitura | readonly LogEntry[] | Sim | What the app and the runtime logged. |
emit | (module: string, name: string, value?: unknown) => Promise<void> | Sim | Sends a native module's event or live value change, as the platform does. |
getByText | (text: TextMatch) => TestView | Sim | The one view showing text; throws when none or several do. |
getAllByText | (text: TextMatch) => TestView[] | Sim | — |
queryByText | (text: TextMatch) => TestView | null | Sim | — |
getByRole | (role: string, options?: RoleOptions) => TestView | Sim | The 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 | null | Sim | — |
tree — assinaturas de método
Assinaturas
(): stringParâmetros
Sem parâmetros.
Devolve
string
emit — assinaturas de método
Assinaturas
(module: string, name: string, value?: unknown): Promise<void>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
module | string | Sim | — |
name | string | Sim | — |
value | unknown | Não | — |
Devolve
Promise<void>
getByText — assinaturas de método
Assinaturas
(text: TextMatch): TestViewParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
text | TextMatch | Sim | — |
Devolve
TestView
getAllByText — assinaturas de método
Assinaturas
(text: TextMatch): TestView[]Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
text | TextMatch | Sim | — |
Devolve
TestView[]
queryByText — assinaturas de método
Assinaturas
(text: TextMatch): TestView | nullParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
text | TextMatch | Sim | — |
Devolve
TestView
getByRole — assinaturas de método
Assinaturas
(role: string, options?: RoleOptions): TestViewParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
role | string | Sim | — |
options | RoleOptions | Não | — |
Devolve
TestView
getAllByRole — assinaturas de método
Assinaturas
(role: string, options?: RoleOptions): TestView[]Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
role | string | Sim | — |
options | RoleOptions | Não | — |
Devolve
TestView[]
queryByRole — assinaturas de método
Assinaturas
(role: string, options?: RoleOptions): TestView | nullParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
role | string | Sim | — |
options | RoleOptions | Nã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.