Skip to content

Commit be6b972

Browse files
committed
test(desktop): restore advanced run location coverage
Co-authored-by: Taylor Ho <[email protected]> Signed-off-by: Taylor Ho <[email protected]>
1 parent 228324f commit be6b972

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

‎desktop/tests/e2e/where-to-run-config.spec.ts‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,17 @@ async function openCreateDialogOnProvider(page: Page) {
9898
name: "Advanced",
9999
exact: true,
100100
});
101-
const runOn = dialog.locator("#agent-run-on");
102101
await expect(advanced).toHaveAttribute("aria-expanded", "false");
103-
await expect(runOn).toBeVisible();
102+
await expect(dialog.locator("#agent-run-on")).toHaveCount(0);
104103
await advanced.click();
105104
await expect(advanced).toHaveAttribute("aria-expanded", "true");
106-
await expect(dialog.getByTestId("agent-respond-to")).toBeVisible();
105+
const respondTo = dialog.getByTestId("agent-respond-to");
106+
const runOn = dialog.locator("#agent-run-on");
107+
await expect(respondTo).toBeVisible();
108+
await expect(runOn).toBeVisible();
109+
expect(await respondTo.evaluate((element) => element.offsetTop)).toBeLessThan(
110+
await runOn.evaluate((element) => element.offsetTop),
111+
);
107112
await selectRunOnOption(page, dialog, PROVIDER.id);
108113
return dialog;
109114
}
@@ -137,7 +142,7 @@ test("typing into a defaultless provider field sticks and probes only once", asy
137142
});
138143
await advanced.click();
139144
await expect(advanced).toHaveAttribute("aria-expanded", "false");
140-
await expect(dialog.locator("#agent-run-on")).toBeVisible();
145+
await expect(dialog.locator("#agent-run-on")).toHaveCount(0);
141146
await advanced.click();
142147
await expect(advanced).toHaveAttribute("aria-expanded", "true");
143148
await expect(dialog.locator("#provider-cfg-context")).toHaveValue(
@@ -175,7 +180,7 @@ test("config fields render only after a slow probe resolves, with defaults", asy
175180
expect(await probeInvocations(page)).toBe(1);
176181
});
177182

178-
test("collapsed Advanced keeps incomplete remote setup blocked", async ({
183+
test("collapsed Advanced marks incomplete remote setup as required", async ({
179184
page,
180185
}) => {
181186
await installMockBridge(page, {
@@ -193,7 +198,10 @@ test("collapsed Advanced keeps incomplete remote setup blocked", async ({
193198
await expect(submit).toBeDisabled();
194199
await advanced.click();
195200
await expect(advanced).toHaveAttribute("aria-expanded", "false");
196-
await expect(dialog.locator("#agent-run-on")).toBeVisible();
201+
await expect(dialog.locator("#agent-run-on")).toHaveCount(0);
202+
await expect(
203+
dialog.getByTestId("persona-advanced-required-badge"),
204+
).toHaveText("Required");
197205
await expect(submit).toBeDisabled();
198206
});
199207

0 commit comments

Comments
 (0)