summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArya Gummadi <[email protected]>2025-08-18 22:56:46 -0700
committerGitHub <[email protected]>2025-08-19 05:56:46 +0000
commitda396bd5662adcac3ebc60d55cfc1d722b903e38 (patch)
treec8f011ea10e8ccab50b746f0349c9dd6ec48b7d5
parent58c2925624c5befe130fbe120707455daf91c910 (diff)
fix: ensure consistent theme behavior between local and CI test runs (#6358)
Co-authored-by: Jacob Richman <[email protected]>
-rw-r--r--integration-tests/globalSetup.ts5
-rw-r--r--packages/cli/src/ui/App.test.tsx28
-rw-r--r--packages/cli/test-setup.ts5
-rw-r--r--packages/core/test-setup.ts5
4 files changed, 43 insertions, 0 deletions
diff --git a/integration-tests/globalSetup.ts b/integration-tests/globalSetup.ts
index 89ca203f..00327a91 100644
--- a/integration-tests/globalSetup.ts
+++ b/integration-tests/globalSetup.ts
@@ -4,6 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
+// Unset NO_COLOR environment variable to ensure consistent theme behavior between local and CI test runs
+if (process.env.NO_COLOR !== undefined) {
+ delete process.env.NO_COLOR;
+}
+
import { mkdir, readdir, rm } from 'fs/promises';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
diff --git a/packages/cli/src/ui/App.test.tsx b/packages/cli/src/ui/App.test.tsx
index d9d368f0..7a369ebc 100644
--- a/packages/cli/src/ui/App.test.tsx
+++ b/packages/cli/src/ui/App.test.tsx
@@ -1100,6 +1100,34 @@ describe('App UI', () => {
});
});
+ describe('NO_COLOR smoke test', () => {
+ let originalNoColor: string | undefined;
+
+ beforeEach(() => {
+ originalNoColor = process.env.NO_COLOR;
+ });
+
+ afterEach(() => {
+ process.env.NO_COLOR = originalNoColor;
+ });
+
+ it('should render without errors when NO_COLOR is set', async () => {
+ process.env.NO_COLOR = 'true';
+
+ const { lastFrame, unmount } = renderWithProviders(
+ <App
+ config={mockConfig as unknown as ServerConfig}
+ settings={mockSettings}
+ version={mockVersion}
+ />,
+ );
+ currentUnmount = unmount;
+
+ expect(lastFrame()).toBeTruthy();
+ expect(lastFrame()).toContain('Type your message or @path/to/file');
+ });
+ });
+
describe('FolderTrustDialog', () => {
it('should display the folder trust dialog when isFolderTrustDialogOpen is true', async () => {
const { useFolderTrust } = await import('./hooks/useFolderTrust.js');
diff --git a/packages/cli/test-setup.ts b/packages/cli/test-setup.ts
index a419c873..6d8930d9 100644
--- a/packages/cli/test-setup.ts
+++ b/packages/cli/test-setup.ts
@@ -4,4 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
+// Unset NO_COLOR environment variable to ensure consistent theme behavior between local and CI test runs
+if (process.env.NO_COLOR !== undefined) {
+ delete process.env.NO_COLOR;
+}
+
import './src/test-utils/customMatchers.js';
diff --git a/packages/core/test-setup.ts b/packages/core/test-setup.ts
index ed06d5f1..64685d18 100644
--- a/packages/core/test-setup.ts
+++ b/packages/core/test-setup.ts
@@ -4,6 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
+// Unset NO_COLOR environment variable to ensure consistent theme behavior between local and CI test runs
+if (process.env.NO_COLOR !== undefined) {
+ delete process.env.NO_COLOR;
+}
+
import { setSimulate429 } from './src/utils/testUtils.js';
// Disable 429 simulation globally for all tests