import { PRODUCT_NAME } from '@rosea/schema'; import { cleanup, render, screen } from '@testing-library/svelte'; import { afterEach, describe, expect, it } from 'vitest'; import Shell from '../src/Shell.svelte'; import { en } from '../src/copy/en.js'; afterEach(cleanup); describe('Shell', () => { it('names the product in the page heading, from the schema constant', () => { render(Shell); expect(screen.getByRole('heading', { level: 1 }).textContent).toBe(PRODUCT_NAME); }); it('shows its one line from copy/, and no control to press', () => { render(Shell); expect(screen.getByText(en.shell.preparing)).toBeTruthy(); expect(screen.queryAllByRole('button')).toEqual([]); expect(screen.queryAllByRole('link')).toEqual([]); }); it('is a landmark, so a screen reader can find it', () => { render(Shell); expect(screen.getByRole('main')).toBeTruthy(); }); });