mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-17 09:41:28 +08:00
test: tab isolation + instruction block generator tests
14 tests covering tab ownership lifecycle (access checks, unowned tabs, transferTab) and instruction block generator (scopes, URLs, admin flag, troubleshooting section). Fix server-auth test that used fragile sliceBetween boundaries broken by new endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,10 +25,10 @@ describe('Server auth security', () => {
|
||||
// Previously token was removed from /health, but extension needs it since
|
||||
// .auth.json in the extension dir breaks read-only .app bundles and codesigning.
|
||||
test('/health serves auth token with safety comment', () => {
|
||||
const healthBlock = sliceBetween(SERVER_SRC, "url.pathname === '/health'", "url.pathname === '/refs'");
|
||||
expect(healthBlock).toContain('token: AUTH_TOKEN');
|
||||
// Must have a comment explaining why this is safe
|
||||
expect(healthBlock).toContain('localhost-only');
|
||||
const healthBlock = sliceBetween(SERVER_SRC, "url.pathname === '/health'", "url.pathname === '/connect'");
|
||||
expect(healthBlock).toContain('healthResponse.token = AUTH_TOKEN');
|
||||
// Must have a comment explaining why this is safe — strip when tunneled
|
||||
expect(healthBlock).toContain('tunnelActive');
|
||||
});
|
||||
|
||||
// Test 2: /refs endpoint requires auth via validateAuth
|
||||
|
||||
Reference in New Issue
Block a user