Show the running version next to the brand; bump to 0.2.1

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Aleksandr BogomiakovandClaude committed 2026-10-07 15:32:20 +01:00
1 parent 6a55988671
commit 5ccf2b1108
9 files changed
+31 -8

No files matched your search

+12
View File
@@ -49,6 +49,10 @@ fs.mkdirSync('test-results', { recursive: true });
assert.equal(await guest.getByRole('link', { name: 'Sign in with SSO' }).isVisible(), !!session.auth.oidc);
const registration = await guest.request.post(base + '/api/register', { headers: { Origin: base }, data: { username: 'intruder1', password: 'long-enough-password', display_name: 'X' } });
assert([404, 405].includes(registration.status()), 'Registration endpoint is gone');
// The running version sits next to the brand on the login screen and on every page after sign-in.
const label = `v${session.version}`;
assert.match(session.version, /^\d+\.\d+\.\d+/);
assert.equal((await guest.locator('.login .brand .app-version').innerText()).trim(), label);
await guest.locator('[data-demo-account=alice]').click();
assert.equal(await guest.getByLabel('Username', { exact: true }).inputValue(), 'alice');
assert.equal(await guest.getByLabel('Password', { exact: true }).inputValue(), secret);
@@ -123,11 +127,19 @@ fs.mkdirSync('test-results', { recursive: true });
await byReference.goto(`${base}/?view=instance&ref=${username}`);
await byReference.locator('#instance-events [data-event-action="user.created"]').first().waitFor();
assert.equal(await byReference.locator('#instance-events input[type=search]').inputValue(), username);
assert.equal((await byReference.locator('.sidebar .brand .app-version').innerText()).trim(), label, 'Version on the instance page');
for (const view of ['calendar', 'requests', 'activity', 'settings']) {
await byReference.goto(`${base}/?view=${view}`);
await byReference.waitForFunction(() => Alpine.$data(document.body).ready);
assert.equal((await byReference.locator('.sidebar .brand .app-version').innerText()).trim(), label, `Version on ${view}`);
}
const mobile = await open({ width: 390, height: 844 });
await signIn(mobile, 'admin');
await mobile.goto(`${base}/?view=instance`);
await mobile.locator('#instance-events .event-row').first().waitFor();
assert(await mobile.evaluate(() => document.documentElement.scrollWidth <= innerWidth), 'Event log must not overflow on mobile');
assert.equal(await mobile.locator('.sidebar .brand .app-version').isVisible(), true, 'The version stays visible on the narrow rail');
await mobile.screenshot({ path: 'test-results/access-version-mobile.png' });
const forbidden = await (await apiLogin('bob')).call('GET', '/api/admin/events');
assert.equal(forbidden.status, 403);
assert.equal((await (await apiLogin('alice')).call('GET', '/api/admin/events?search=x')).status, 403);