fix: ensure consistent theme behavior between local and CI test runs (#6358)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Arya Gummadi 2025-08-18 22:56:46 -07:00 committed by GitHub
parent 58c2925624
commit da396bd566
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 0 deletions

View File

@ -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';

View File

@ -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');

View File

@ -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';

View File

@ -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