From c1a637d7648c0a15fecfc141e47351ab33f9806a Mon Sep 17 00:00:00 2001 From: James Brunton Date: Mon, 15 Jun 2026 11:26:29 +0100 Subject: [PATCH] Fix CI errors in SaaS (#6662) # Description of Changes Fix CI errors in #6578 to make SaaS branch ready for merge into main --- .../security/InitialSecuritySetupTest.java | 6 +++++- .../editor/public/locales/en-US/translation.toml | 1 + .../editor/src/core/tests/helpers/api-stubs.ts | 2 +- .../tests/stubbed/files-page-screenshots.spec.ts | 9 ++++++++- .../src/core/tests/stubbed/files-page.spec.ts | 5 ++++- .../core/tests/stubbed/policy-admin-gate.spec.ts | 2 +- .../src/proprietary/components/AppProviders.tsx | 14 +++++++------- scripts/sync_en_us_spelling.py | 1 - 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/proprietary/src/test/java/stirling/software/proprietary/security/InitialSecuritySetupTest.java b/app/proprietary/src/test/java/stirling/software/proprietary/security/InitialSecuritySetupTest.java index 12620b6e8..adf948609 100644 --- a/app/proprietary/src/test/java/stirling/software/proprietary/security/InitialSecuritySetupTest.java +++ b/app/proprietary/src/test/java/stirling/software/proprietary/security/InitialSecuritySetupTest.java @@ -16,6 +16,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.core.env.Environment; import org.springframework.test.util.ReflectionTestUtils; import stirling.software.common.model.ApplicationProperties; @@ -36,6 +37,7 @@ class InitialSecuritySetupTest { @Mock private TeamService teamService; @Mock private DatabaseServiceInterface databaseService; @Mock private UserLicenseSettingsService licenseSettingsService; + @Mock private Environment environment; private ApplicationProperties applicationProperties; private InitialSecuritySetup initialSecuritySetup; @@ -53,13 +55,15 @@ class InitialSecuritySetupTest { when(userService.findByUsernameIgnoreCase(Role.INTERNAL_API_USER.getRoleId())) .thenReturn(Optional.of(internalUser)); when(teamService.getOrCreateInternalTeam()).thenReturn(internalTeam); + when(environment.getActiveProfiles()).thenReturn(new String[] {}); initialSecuritySetup = new InitialSecuritySetup( userService, teamService, applicationProperties, databaseService, - licenseSettingsService); + licenseSettingsService, + environment); } @Test diff --git a/frontend/editor/public/locales/en-US/translation.toml b/frontend/editor/public/locales/en-US/translation.toml index 9bf3af718..5b22c3064 100644 --- a/frontend/editor/public/locales/en-US/translation.toml +++ b/frontend/editor/public/locales/en-US/translation.toml @@ -2714,6 +2714,7 @@ need_clarification = "Could you clarify your request?" not_found = "I couldn't find the requested information." processing = "Processing ({{outcome}})..." unsupported_capability = "Unsupported capability: {{capability}}" +usage_limit_reached = "You've reached your usage limit. Check your plan options to keep going." [chat.toolsUsed] summary = "Ran {{count}} tools" diff --git a/frontend/editor/src/core/tests/helpers/api-stubs.ts b/frontend/editor/src/core/tests/helpers/api-stubs.ts index 510798c45..c87cdfa54 100644 --- a/frontend/editor/src/core/tests/helpers/api-stubs.ts +++ b/frontend/editor/src/core/tests/helpers/api-stubs.ts @@ -183,7 +183,7 @@ export async function mockAppApis( // Current user — anonymous by default, configurable for authenticated flows await page.route("**/api/v1/auth/me", (route: Route) => - route.fulfill({ json: user }), + route.fulfill({ json: { user } }), ); // Tool availability — every tool enabled unless overridden diff --git a/frontend/editor/src/core/tests/stubbed/files-page-screenshots.spec.ts b/frontend/editor/src/core/tests/stubbed/files-page-screenshots.spec.ts index da4d889a9..fffa1b4b6 100644 --- a/frontend/editor/src/core/tests/stubbed/files-page-screenshots.spec.ts +++ b/frontend/editor/src/core/tests/stubbed/files-page-screenshots.spec.ts @@ -141,7 +141,14 @@ async function settle(page: Page, ms = 350): Promise { } test.describe("Files page screenshots", () => { - test.use({ autoGoto: false, viewport: { width: 1600, height: 900 } }); + // Seed a logged-in session: the cloud-folder surfaces (move-dialog + // create-folder, the seeded "Reports" folder) only render once a confirmed, + // non-anonymous user triggers the folder pull (see FolderContext gating). + test.use({ + autoGoto: false, + viewport: { width: 1600, height: 900 }, + seedJwt: true, + }); test("01_empty_state_ctas", async ({ page }) => { await stubStorageApis(page); diff --git a/frontend/editor/src/core/tests/stubbed/files-page.spec.ts b/frontend/editor/src/core/tests/stubbed/files-page.spec.ts index 081d1c83f..7c08d943b 100644 --- a/frontend/editor/src/core/tests/stubbed/files-page.spec.ts +++ b/frontend/editor/src/core/tests/stubbed/files-page.spec.ts @@ -539,7 +539,10 @@ test.describe("Files page", () => { }); test.describe("Move dialog inline create-folder", () => { - test.use({ autoGoto: false }); + // The inline create-folder affordance is gated on `serverReachable`, which + // only flips true once a confirmed, non-anonymous user triggers the folder + // pull (see FolderContext). Seed a JWT so the stubbed session is logged-in. + test.use({ autoGoto: false, seedJwt: true }); test("Move dialog shows Create new folder affordance", async ({ page }) => { await stubStorageApis(page); diff --git a/frontend/editor/src/core/tests/stubbed/policy-admin-gate.spec.ts b/frontend/editor/src/core/tests/stubbed/policy-admin-gate.spec.ts index 20f77cae6..d8bd30746 100644 --- a/frontend/editor/src/core/tests/stubbed/policy-admin-gate.spec.ts +++ b/frontend/editor/src/core/tests/stubbed/policy-admin-gate.spec.ts @@ -16,7 +16,7 @@ import { test, expect } from "@app/tests/helpers/stub-test-base"; */ const LOCKED_TITLE = "Managed by your organization"; -const LOCKED_DESC = "Contact an admin to change this policy."; +const LOCKED_DESC = "Contact a team leader to change this policy."; /** Open the Security policy from the right-sidebar Policies list. */ async function openSecurityPolicy(page: import("@playwright/test").Page) { diff --git a/frontend/editor/src/proprietary/components/AppProviders.tsx b/frontend/editor/src/proprietary/components/AppProviders.tsx index 06b5ddb69..f937d3cfe 100644 --- a/frontend/editor/src/proprietary/components/AppProviders.tsx +++ b/frontend/editor/src/proprietary/components/AppProviders.tsx @@ -16,11 +16,11 @@ export function AppProviders({ appConfigProviderProps, }: AppProvidersProps) { return ( - - + + @@ -31,7 +31,7 @@ export function AppProviders({ - - + + ); } diff --git a/scripts/sync_en_us_spelling.py b/scripts/sync_en_us_spelling.py index e60f170fc..221aefc9b 100644 --- a/scripts/sync_en_us_spelling.py +++ b/scripts/sync_en_us_spelling.py @@ -100,7 +100,6 @@ _RE = { # ‘Calibre’ (the e-book conversion tool), not the British ‘caliber’. "sombre": "somber", "spectre": "specter", "lustre": "luster", "theatre": "theater", "theatres": "theaters", - "metre": "meter", "centimetre": "centimeter", "centimetres": "centimeters", "millimetre": "millimeter", "millimetres": "millimeters", "kilometre": "kilometer", "kilometres": "kilometers",