Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions apps/web/src/app/AppShell.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ vi.mock('./ThemeToggle', () => ({
describe('AppShell', () => {
afterEach(() => {
delete runtimeWindow.__OPENClockwork_CONFIG__;
vi.restoreAllMocks();
});

it('keeps the demo notice within the available page width', () => {
Expand Down Expand Up @@ -132,25 +133,30 @@ describe('AppShell', () => {
expect(screen.queryByRole('menu')).toBeNull();
});

it('shows the attribution footer on admin routes only', () => {
const { unmount } = render(
<MemoryRouter initialEntries={['/admin/requests']}>
<Routes>
<Route element={<AppShell />}>
<Route path="admin/requests" element={<div>Approval inbox</div>} />
</Route>
</Routes>
</MemoryRouter>,
describe.each([
{ locale: 'de', versionLabel: 'OpenClockwork-Version' },
{ locale: 'en', versionLabel: 'OpenClockwork version' },
])('attribution footer in $locale', ({ locale, versionLabel }) => {
it.each(['/settings', '/admin/requests'])(
'shows the attribution and version on %s',
(path) => {
vi.spyOn(navigator, 'languages', 'get').mockReturnValue([locale]);
render(
<MemoryRouter initialEntries={[path]}>
<AppShell />
</MemoryRouter>,
);

const footer = screen.getByRole('contentinfo');
expect(Array.from(footer.children, (line) => line.textContent)).toEqual([
'Crafted with ❤️ in Würzburg by Patrick & AI',
`${versionLabel} ${APP_VERSION}`,
]);
},
);
});

expect(
screen.getByText('Crafted with ❤️ in Würzburg by Patrick Schiller'),
).toBeDefined();
expect(
screen.getByText(`OpenClockwork-Version ${APP_VERSION}`),
).toBeDefined();

unmount();
it('omits the attribution footer on the dashboard', () => {
render(
<MemoryRouter initialEntries={['/']}>
<Routes>
Expand All @@ -161,12 +167,7 @@ describe('AppShell', () => {
</MemoryRouter>,
);

expect(
screen.queryByText('Crafted with ❤️ in Würzburg by Patrick Schiller'),
).toBeNull();
expect(
screen.queryByText(`OpenClockwork-Version ${APP_VERSION}`),
).toBeNull();
expect(screen.queryByRole('contentinfo')).toBeNull();
});

it('constrains full Solo bottom labels in five narrow columns without shrinking touch targets', () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const de: Catalog = {
'shell.installHint':
'OpenClockwork als App installieren — schneller Zugriff und Offline-Hinweis.',
'shell.closeInstall': 'Installations-Hinweis schließen',
'shell.adminFooter': 'Crafted with ❤️ in Würzburg by Patrick Schiller',
'shell.adminFooter': 'Crafted with ❤️ in Würzburg by Patrick & AI',
'shell.adminVersion': 'OpenClockwork-Version {version}',
'login.description': 'Anmeldung mit E-Mail und Passwort',
'login.password': 'Passwort',
Expand Down Expand Up @@ -1122,7 +1122,7 @@ const en: Catalog = {
'shell.installHint':
'Install OpenClockwork as an app for faster access and offline notices.',
'shell.closeInstall': 'Close installation notice',
'shell.adminFooter': 'Crafted with ❤️ in Würzburg by Patrick Schiller',
'shell.adminFooter': 'Crafted with ❤️ in Würzburg by Patrick & AI',
'shell.adminVersion': 'OpenClockwork version {version}',
'login.description': 'Sign in with email and password',
'login.password': 'Password',
Expand Down