Unified · Split
| @@ -34,7 +34,7 @@ import { Effect } from "effect"; · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | import { scenario } from "../src/scenario"; |
| 36 | 36 | import { Browser, Target } from "../src/services"; |
| 37 | −import { setPresetChecked } from "./support/picker"; | |
| 37 | +import { clearCheckedPresets, setPresetChecked } from "./support/picker"; | |
| 38 | 38 | |
| 39 | 39 | scenario( |
| 40 | 40 | "Google · the per-service picker fans out to separate integrations and skips existing ones", |
| @@ -59,17 +59,7 @@ scenario( · 18 unmodified lines | ||
| 59 | 59 | async () => { |
| 60 | 60 | // Clear every featured default, then select only the three preset |
| 61 | 61 | // products under test. |
| 62 | − const featuredDefaults = [ | |
| 63 | − "google-calendar", | |
| 64 | − "google-gmail", | |
| 65 | − "google-sheets", | |
| 66 | − "google-drive", | |
| 67 | − "google-docs", | |
| 68 | − ]; | |
| 69 | − for (const presetId of featuredDefaults) { | |
| 70 | − await setPresetChecked(page, presetId, false); | |
| 71 | − } | |
| 72 | − | |
| 62 | + await clearCheckedPresets(page); | |
| 73 | 63 | for (const presetId of ["google-calendar", "google-gmail", "google-drive"]) { |
| 74 | 64 | await setPresetChecked(page, presetId, true); |
| 75 | 65 | } |
| @@ -152,9 +142,7 @@ scenario( · 76 unmodified lines | ||
| 152 | 142 | await page.getByText("Customize your Google connection").waitFor(); |
| 153 | 143 | |
| 154 | 144 | // Clear the featured defaults so only Calendar (already added) is checked. |
| 155 | − for (const presetId of ["google-gmail", "google-sheets", "google-drive", "google-docs"]) { | |
| 156 | − await setPresetChecked(page, presetId, false); | |
| 157 | − } | |
| 145 | + await clearCheckedPresets(page); | |
| 158 | 146 | await setPresetChecked(page, "google-calendar", true); |
| 159 | 147 | |
| 160 | 148 | await page.getByTestId("google-add-submit").click(); |
| @@ -26,7 +26,7 @@ import { Effect } from "effect"; · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | import { scenario } from "../src/scenario"; |
| 28 | 28 | import { Browser, Target } from "../src/services"; |
| 29 | −import { setPresetChecked } from "./support/picker"; | |
| 29 | +import { clearCheckedPresets, setPresetChecked } from "./support/picker"; | |
| 30 | 30 | |
| 31 | 31 | scenario( |
| 32 | 32 | "Microsoft · the per-workload picker fans out to separate integrations and skips existing ones", |
| @@ -46,11 +46,8 @@ scenario( · 13 unmodified lines | ||
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | 48 | await step("Clear defaults, check Mail + Calendar, and add a custom scope", async () => { |
| 49 | − // The featured defaults (profile, mail, calendar, contacts, tasks, files) | |
| 50 | − // start checked; clear them, then select only the two under test. | |
| 51 | − for (const presetId of ["profile", "mail", "calendar", "contacts", "tasks", "files"]) { | |
| 52 | − await setPresetChecked(page, presetId, false); | |
| 53 | − } | |
| 49 | + // Clear every checked default, then select only the two under test. | |
| 50 | + await clearCheckedPresets(page); | |
| 54 | 51 | for (const presetId of ["mail", "calendar"]) { |
| 55 | 52 | await setPresetChecked(page, presetId, true); |
| 56 | 53 | } |
| @@ -66,7 +63,12 @@ scenario( · 9 unmodified lines | ||
| 66 | 63 | await page.getByTestId("microsoft-add-submit").click(); |
| 67 | 64 | // Each workload fetches + stream-compiles the 37MB Graph spec; allow a |
| 68 | 65 | // wide window for the result panel to populate. |
| 69 | − await page.getByTestId("microsoft-add-results").waitFor({ timeout: 300_000 }); | |
| 66 | + const results = page.getByTestId("microsoft-add-results"); | |
| 67 | + await results.waitFor({ timeout: 300_000 }); | |
| 68 | + expect( | |
| 69 | + await results.locator('[data-testid^="add-result-row-"]').count(), | |
| 70 | + "only Mail, Calendar, and the custom scope are created", | |
| 71 | + ).toBe(3); | |
| 70 | 72 | |
| 71 | 73 | for (const presetId of ["mail", "calendar"]) { |
| 72 | 74 | const row = page.getByTestId(`add-result-row-${presetId}`); |
| @@ -118,9 +120,7 @@ scenario( · 45 unmodified lines | ||
| 118 | 120 | await page.goto("/integrations/add/microsoft", { waitUntil: "domcontentloaded" }); |
| 119 | 121 | await page.getByText("Customize Microsoft Graph").waitFor(); |
| 120 | 122 | |
| 121 | − for (const presetId of ["profile", "mail", "calendar", "contacts", "tasks", "files"]) { | |
| 122 | − await setPresetChecked(page, presetId, false); | |
| 123 | − } | |
| 123 | + await clearCheckedPresets(page); | |
| 124 | 124 | await setPresetChecked(page, "mail", true); |
| 125 | 125 | |
| 126 | 126 | await page.getByTestId("microsoft-add-submit").click(); |
| @@ -27,3 +27,24 @@ export const setPresetChecked = async ( · 26 unmodified lines | ||
| 27 | 27 | ) |
| 28 | 28 | .toBe(String(checked)); |
| 29 | 29 | }; |
| 30 | + | |
| 31 | +export const clearCheckedPresets = async (page: Page): Promise<void> => { | |
| 32 | + const boxes = page.locator('[data-testid^="preset-checkbox-"]'); | |
| 33 | + await boxes.first().waitFor(); | |
| 34 | + | |
| 35 | + const checkedPresetIds: string[] = []; | |
| 36 | + const count = await boxes.count(); | |
| 37 | + for (let index = 0; index < count; index += 1) { | |
| 38 | + const box = boxes.nth(index); | |
| 39 | + if ((await box.getAttribute("aria-checked")) !== "true") continue; | |
| 40 | + | |
| 41 | + const testId = await box.getAttribute("data-testid"); | |
| 42 | + if (testId?.startsWith("preset-checkbox-")) { | |
| 43 | + checkedPresetIds.push(testId.slice("preset-checkbox-".length)); | |
| 44 | + } | |
| 45 | + } | |
| 46 | + | |
| 47 | + for (const presetId of checkedPresetIds) { | |
| 48 | + await setPresetChecked(page, presetId, false); | |
| 49 | + } | |
| 50 | +}; | |
| @@ -418,7 +418,6 @@ const program = Effect.gen(function* () { · 417 unmodified lines | ||
| 418 | 418 | console.log(" executor.fileSecrets.filePath: ", executor.fileSecrets.filePath); |
| 419 | 419 | |
| 420 | 420 | // executor.mcp.addServer({ transport: "remote", name: "...", endpoint: "...", slug: "..." }); |
| 421 | − // executor.google.addBundle({ urls: ["..."], slug: "google" }); | |
| 422 | 421 | // executor.onepassword.configure({ auth: { kind: "desktop-app", accountName: "..." }, vaultId: "..." }); |
| 423 | 422 | |
| 424 | 423 | // ------------------------------------------------------------------------- |