Files

13 lines
585 B
TypeScript

import { screen } from '@testing-library/svelte';
/**
* The one status line Rosea herself speaks through. Every @domi/ui button also carries a hidden status of its own
* (`.domi-sr`, empty until the button works on a Promise, which Rosea's never do: domi-ui.md D2), so "the" status
* is the one that is not a button's.
*/
export function said(): HTMLElement {
const own = screen.getAllByRole('status').filter((el) => !el.classList.contains('domi-sr'));
if (own.length !== 1) throw new Error(`expected one status line of Rosea's own, found ${own.length}`);
return own[0]!;
}