Utilização

Assert a view's bounds.

tsx
// 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

ts
export interface Edges {
  top: number;
  right: number;
  bottom: number;
  left: number;
}

Membros 4

NomeTipoObrigatórioDescrição
topnumberSim—
rightnumberSim—
bottomnumberSim—
leftnumberSim—
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.