mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
test(cloud): DS-b team-switch fixture carries the team detail and Switch action, as the app does
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Users } from 'lucide-react'
|
||||
import { defineFixture } from '../../component-fixtures/component-fixture'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import type { CloudSetupStep } from '@/components/new-workspace/run-on/cloud-start-model'
|
||||
import { CloudSetupPage } from './CloudSetupPage'
|
||||
import { cloudSetupPageModel } from './cloud-setup-page-model'
|
||||
@@ -6,6 +8,14 @@ import type { CloudSetupFlow } from './use-cloud-setup-flow'
|
||||
|
||||
const noop = (): void => {}
|
||||
|
||||
// What the app's team-switch hook supplies on "Switch to your team" (its one action).
|
||||
const switchTeamAction = (
|
||||
<Button size="sm" variant="outline">
|
||||
<Users aria-hidden />
|
||||
Switch to Orca Staging Eval Team
|
||||
</Button>
|
||||
)
|
||||
|
||||
function flow(rows: CloudSetupStep[], teamSwitch = false): CloudSetupFlow {
|
||||
return {
|
||||
...cloudSetupPageModel(rows, { teamSwitch }),
|
||||
@@ -17,7 +27,7 @@ function flow(rows: CloudSetupStep[], teamSwitch = false): CloudSetupFlow {
|
||||
inBrowser: false,
|
||||
error: null,
|
||||
canManageBilling: true,
|
||||
teamAction: null,
|
||||
teamAction: teamSwitch ? switchTeamAction : null,
|
||||
continueInBrowser: noop,
|
||||
startTrial: noop,
|
||||
fixBilling: noop,
|
||||
@@ -120,7 +130,12 @@ export const teamSwitchPlanUnknown = defineFixture({
|
||||
page(
|
||||
[
|
||||
{ id: 'account', state: 'done' },
|
||||
{ id: 'team', state: 'needed' },
|
||||
{
|
||||
id: 'team',
|
||||
state: 'needed',
|
||||
detail:
|
||||
'Cloud workspaces belong to a team. Orca Staging Eval Team has a Team plan. Switch to start this workspace there.'
|
||||
},
|
||||
{ id: 'github', state: 'needed', need: 'github', canFix: true },
|
||||
{ id: 'agent', state: 'optional' }
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user