tests.Edges
Insets on each edge of the test's screen, in points, such as what the status bar and home indicator cover.
Verwendung
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);
});Typdeklaration
export interface Edges {
top: number;
right: number;
bottom: number;
left: number;
}Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
top | number | Ja | — |
right | number | Ja | — |
bottom | number | Ja | — |
left | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.