Skip to content

Commit ae42812

Browse files
dante01yoonampagent
andcommitted
test: verify local workspace billing authentication
Amp-Thread-ID: https://ampcode.com/threads/T-01a017d8-079a-716e-8b5d-464349c14401 Co-authored-by: Amp <amp@ampcode.com>
1 parent c96280f commit ae42812

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

browser_tests/tests/workspace/localWorkspaceSwitcher.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ test.describe('Local workspace switcher', { tag: '@auth' }, () => {
1616
const localOrigin = new URL(page.url()).origin
1717
const billingRequestUrls: string[] = []
1818
const localBillingRequestUrls: string[] = []
19+
const billingAuthorizationHeaders: string[] = []
1920
let tokenRequestBody: unknown
2021

2122
page.on('request', (request) => {
2223
if (!request.url().includes('/api/billing/')) return
2324
billingRequestUrls.push(request.url())
25+
billingAuthorizationHeaders.push(request.headers().authorization ?? '')
2426
if (new URL(request.url()).origin === localOrigin) {
2527
localBillingRequestUrls.push(request.url())
2628
}
@@ -72,6 +74,9 @@ test.describe('Local workspace switcher', { tag: '@auth' }, () => {
7274
])
7375
)
7476
expect(localBillingRequestUrls).toEqual([])
77+
await expect
78+
.poll(() => billingAuthorizationHeaders)
79+
.toContain('Bearer mock-workspace-token-ws-team')
7580
await expect
7681
.poll(() => comfyPage.menu.topbar.getTabNames())
7782
.toContain(workflowName)

0 commit comments

Comments
 (0)