fix: resolve CI failures from integrations onboarding step
- Fix TypeScript error: InitIntegrations returning null by transitioning to done phase instead - Fix TypeScript error: Object.fromEntries cast in integration grids by typing the array elements - Update E2E onboarding tests to process the new integrations step (skip for now) and increase finish assertion timeout for async mutation
This commit is contained in:
6 files changed
+14
-6
No files matched your search
@@ -57,7 +57,8 @@ export const InitIntegrations = () => {
|
||||
if (phase === "configure") {
|
||||
const currentKind = selectedKinds[currentIndex];
|
||||
if (currentKind === undefined) {
|
||||
return null;
|
||||
setPhase("done");
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -16,8 +16,8 @@ interface IntegrationMultiSelectGridProps {
|
||||
}
|
||||
|
||||
const getWidgetsByIntegration = () => {
|
||||
const map: Record<IntegrationKind, WidgetKind[]> = Object.fromEntries(
|
||||
integrationKinds.map((kind) => [kind, []]),
|
||||
const map = Object.fromEntries(
|
||||
integrationKinds.map((kind) => [kind, [] as WidgetKind[]]),
|
||||
) as Record<IntegrationKind, WidgetKind[]>;
|
||||
|
||||
for (const [widgetKind, widget] of Object.entries(widgetImports) as [
|
||||
|
||||
@@ -16,8 +16,8 @@ interface IntegrationSelectGridProps {
|
||||
}
|
||||
|
||||
const getWidgetsByIntegration = () => {
|
||||
const map: Record<IntegrationKind, WidgetKind[]> = Object.fromEntries(
|
||||
integrationKinds.map((kind) => [kind, []]),
|
||||
const map = Object.fromEntries(
|
||||
integrationKinds.map((kind) => [kind, [] as WidgetKind[]]),
|
||||
) as Record<IntegrationKind, WidgetKind[]>;
|
||||
|
||||
for (const [widgetKind, widget] of Object.entries(widgetImports) as [
|
||||
|
||||
@@ -31,6 +31,7 @@ describe("Onboarding", () => {
|
||||
confirmPassword: "Comp(exP4sswOrd",
|
||||
});
|
||||
await actions.processSettingsStepAsync();
|
||||
await actions.processIntegrationsStepAsync();
|
||||
|
||||
// Assert
|
||||
await assertions.assertFinishStepVisibleAsync();
|
||||
@@ -72,6 +73,7 @@ describe("Onboarding", () => {
|
||||
name: externalGroupName,
|
||||
});
|
||||
await actions.processSettingsStepAsync();
|
||||
await actions.processIntegrationsStepAsync();
|
||||
|
||||
// Assert
|
||||
await assertions.assertFinishStepVisibleAsync();
|
||||
|
||||
@@ -51,4 +51,9 @@ export class OnboardingActions {
|
||||
await this.page.waitForSelector("text=Analytics");
|
||||
await this.page.locator("css=button[type='submit']").click();
|
||||
}
|
||||
|
||||
public async processIntegrationsStepAsync() {
|
||||
await this.page.waitForSelector("text=integrations you'd like to connect");
|
||||
await this.page.locator("button", { hasText: "Skip for now" }).click();
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,6 @@ export class OnboardingAssertions {
|
||||
}
|
||||
|
||||
public async assertFinishStepVisibleAsync() {
|
||||
await this.page.waitForSelector("text=completed the setup", { timeout: 5000 });
|
||||
await this.page.waitForSelector("text=completed the setup", { timeout: 15000 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user