[ui] DomiUi: Rosea's buttons and town search on @domi/ui v1.0.4 (CPAL-1.0, vendored by its own tool into packages/domi-ui), the licence credit at the foot of every screen, the README's copy line and public-domain sources; before-and-after pictures by pnpm look:shots
This commit is contained in:
@@ -3,6 +3,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/sv
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import Shell from '../src/Shell.svelte';
|
||||
import { en } from '../src/copy/en.js';
|
||||
import { said } from './said.js';
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
@@ -19,6 +20,25 @@ const LETTER = [
|
||||
|
||||
const h1 = (): HTMLElement => screen.getByRole('heading', { level: 1 });
|
||||
|
||||
describe('the licence credit (CPAL-1.0 Exhibit B; domi-ui.md D9)', () => {
|
||||
const credit = 'Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák';
|
||||
|
||||
it('stands at the foot of the first screen in its exact words, as plain text that leads nowhere', () => {
|
||||
render(Shell);
|
||||
const line = screen.getByText(credit);
|
||||
expect(line.textContent).toBe(credit);
|
||||
expect(line.closest('a')).toBeNull();
|
||||
expect(document.querySelectorAll('a[href^="https://aula"]')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('stands at the foot of the Letter too', async () => {
|
||||
window.location.hash = '#letter';
|
||||
render(Shell, { letter: LETTER });
|
||||
await waitFor(() => expect(h1().textContent).toBe(en.letter.title));
|
||||
expect(screen.getByText(credit)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Shell', () => {
|
||||
it('names the product in the page heading, from the schema constant', () => {
|
||||
render(Shell);
|
||||
@@ -94,7 +114,7 @@ describe('Shell and a new version waiting (calm-refresh.md)', () => {
|
||||
it('when one waits: one quiet line and Refresh, which only the player\'s tap sends', async () => {
|
||||
let refreshed = 0;
|
||||
render(Shell, { updateReady: true, onrefresh: () => (refreshed += 1) });
|
||||
expect(screen.getByRole('status').textContent).toBe(en.update.ready);
|
||||
expect(said().textContent).toBe(en.update.ready);
|
||||
expect(refreshed).toBe(0);
|
||||
await fireEvent.click(screen.getByRole('button', { name: en.update.refresh }));
|
||||
expect(refreshed).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user