mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
- N9: orca://cloud/setup/return?session=cs_… is routed (open-url + second
instance), validated, focuses Orca and fans out to renderer listeners
(onCloudSetupReturn) so the setup session re-reads at once.
- N10: cloud_setup_step_{started,done,failed}, cloud_setup_first_sandbox and
cloud_setup_plan_chosen, enum-only, derived from the setup rows.
- X1: setup error kinds (timed_out, checkout_canceled, bank_step,
trial_unavailable, team_create_failed, wrong_account) and their actions.
- B2: billing POST /v1/billing/team-plans returns other teams' plan state with
the caller's own token; auth confirms membership from that token (no new
credential). Desktop IPC billingTeamPlans + useSwitchToPlannedTeam. The team
switch logic moves out of SidebarTeamSubmenu so the composer can reuse it.
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
findOrcaCloudSetupReturnLink,
|
|
parseOrcaCloudSetupReturnLink
|
|
} from './orca-cloud-setup-link'
|
|
|
|
const ID = 'cs_AbCdEfGhIjKlMnOpQrSt_-'
|
|
|
|
describe('parseOrcaCloudSetupReturnLink', () => {
|
|
it('accepts the done page link with a well-formed session id', () => {
|
|
expect(parseOrcaCloudSetupReturnLink(`orca://cloud/setup/return?session=${ID}`)).toEqual({
|
|
sessionId: ID
|
|
})
|
|
expect(parseOrcaCloudSetupReturnLink(`orca://cloud/setup/return/?session=${ID}`)).toEqual({
|
|
sessionId: ID
|
|
})
|
|
})
|
|
|
|
it('rejects other hosts, paths, schemes and malformed ids', () => {
|
|
for (const raw of [
|
|
'orca://cloud/setup/return',
|
|
'orca://cloud/setup/return?session=',
|
|
'orca://cloud/setup/return?session=cs_short',
|
|
`orca://cloud/setup/return?session=${ID}x`,
|
|
'orca://cloud/setup/return?session=cs_AbCdEfGhIjKlMnOpQr%2F_-',
|
|
`orca://cloud/setup/other?session=${ID}`,
|
|
`orca://billing/setup/return?session=${ID}`,
|
|
`orca://cloud/w/setup/return?session=${ID}`,
|
|
`https://cloud/setup/return?session=${ID}`,
|
|
'not a url'
|
|
]) {
|
|
expect(parseOrcaCloudSetupReturnLink(raw)).toBeNull()
|
|
}
|
|
})
|
|
|
|
it('finds the link among launch arguments', () => {
|
|
expect(
|
|
findOrcaCloudSetupReturnLink(['--flag', `orca://cloud/setup/return?session=${ID}`])
|
|
).toEqual({ sessionId: ID })
|
|
expect(findOrcaCloudSetupReturnLink(['--flag'])).toBeNull()
|
|
})
|
|
})
|