tests.Edges
Insets on each edge of the test's screen, in points, such as what the status bar and home indicator cover.
Utilização
Assert a view's bounds.
// Assert a view's bounds.
import { SafeArea, Text } from 'kuito';
import { assert, render, screen, test, type Edges } from 'kuito/tests';
// A phone with a notch in landscape: the sides are covered, not the top.
const landscapeInsets: Edges = { top: 0, right: 62, bottom: 21, left: 62 };
test('content clears the notch in landscape', async () => {
await render(
<SafeArea>
<Text>Now playing</Text>
</SafeArea>,
{ screen: { width: 874, height: 402, scale: 3, insets: landscapeInsets } },
);
assert.ok(screen.getByText('Now playing').windowFrame.x >= landscapeInsets.left);
});Declaração do tipo
export interface Edges {
top: number;
right: number;
bottom: number;
left: number;
}Membros 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
top | number | Sim | — |
right | number | Sim | — |
bottom | number | Sim | — |
left | number | Sim | — |
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.