mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 08:29:42 +02:00
test(doctor): minimal-PATH searchDirs regression and the non-admin gate
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JrzFKEdBLwVfu6ev2ZscJS
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
294ce0a667
commit
4152ee1015
@@ -93,4 +93,16 @@ describe('Diagnostics panel in a real browser', () => {
|
||||
await page.waitForFunction(() => /boom/.test(document.getElementById('doctorResult')?.textContent ?? ''));
|
||||
expect(await page.isDisabled('#doctorRunBtn')).toBe(false);
|
||||
});
|
||||
|
||||
it('hides the Diagnostics group from a non-admin in multi-user mode and shows it to an admin', async () => {
|
||||
const visible = (user: Record<string, unknown>) =>
|
||||
page.evaluate((u) => {
|
||||
(window as any).__codemanUser = u;
|
||||
document.dispatchEvent(new CustomEvent('codeman:me'));
|
||||
return getComputedStyle(document.getElementById('doctorGroup')!).display !== 'none';
|
||||
}, user);
|
||||
expect(await visible({ multiUser: true, role: 'user' })).toBe(false);
|
||||
expect(await visible({ multiUser: true, role: 'admin' })).toBe(true);
|
||||
expect(await visible({ multiUser: false })).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user