mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* fix(app/e2e): fix composer-lock test — use mock provider + prompt so lock releases
Two bugs in the "composer is locked while new workspace agent is being
created" test:
1. expectComposerDisabled used toBeDisabled() but React Native TextInput
with editable={false} renders as <textarea readonly> on web, not
<textarea disabled>. Fixed to not.toBeEditable().
2. clickNewWorkspaceButton created an agent with no prompt, leaving the
agent permanently "idle". showPendingCreateSubmitLoading only clears
when authoritativeStatus is non-bootstrapping, but "idle" counts as
bootstrapping — so the composer lock never released. Fixed by opening
the new-workspace composer, filling a prompt, then clicking Create so
the mock agent transitions to "running" after agent_created is released.
Also switches buildCreateAgentPreferences to provider "mock" with the
ten-second-stream model so E2E tests exercise app behavior without
depending on real provider availability.
* fix(app): add aria-checked to Switch for E2E toBeChecked() assertions
React Native Web does not map accessibilityState.checked to aria-checked
for role="switch", so Playwright's toBeChecked() always finds the element
unchecked. Adding aria-checked={value} directly to the Pressable sets the
attribute explicitly.
Update the switch.test.tsx mock to accept and pass through the explicit
aria-checked prop, keeping the mock faithful to the fixed component.
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
export const TEST_HOST_LABEL = "localhost";
|
|
|
|
export const TEST_PROVIDER_PREFERENCES = {
|
|
claude: { model: "haiku" },
|
|
codex: { model: "gpt-5.4-mini", thinkingOptionId: "low" },
|
|
} as const;
|
|
|
|
export function buildDirectTcpConnection(endpoint: string) {
|
|
return {
|
|
id: `direct:${endpoint}`,
|
|
type: "directTcp" as const,
|
|
endpoint,
|
|
};
|
|
}
|
|
|
|
export function buildSeededHost(input: {
|
|
serverId: string;
|
|
endpoint: string;
|
|
label?: string;
|
|
nowIso: string;
|
|
}) {
|
|
const connection = buildDirectTcpConnection(input.endpoint);
|
|
return {
|
|
serverId: input.serverId,
|
|
label: input.label ?? TEST_HOST_LABEL,
|
|
connections: [connection],
|
|
preferredConnectionId: connection.id,
|
|
createdAt: input.nowIso,
|
|
updatedAt: input.nowIso,
|
|
};
|
|
}
|
|
|
|
export const TEST_MOCK_PROVIDER_PREFERENCES = {
|
|
...TEST_PROVIDER_PREFERENCES,
|
|
mock: { model: "ten-second-stream" },
|
|
} as const;
|
|
|
|
export function buildCreateAgentPreferences(serverId: string) {
|
|
return {
|
|
serverId,
|
|
provider: "mock" as const,
|
|
providerPreferences: TEST_MOCK_PROVIDER_PREFERENCES,
|
|
};
|
|
}
|