mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 18:14:29 -07:00
fix(accessibility) allow line wrapper in screen reader mode (#11317)
This commit is contained in:
@@ -486,4 +486,47 @@ describe('startInteractiveUI', () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
expect(checkForUpdates).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
screenReader: true,
|
||||
expectedCalls: [],
|
||||
name: 'should not disable line wrapping in screen reader mode',
|
||||
},
|
||||
{
|
||||
screenReader: false,
|
||||
expectedCalls: [['\x1b[?7l']],
|
||||
name: 'should disable line wrapping when not in screen reader mode',
|
||||
},
|
||||
])('$name', async ({ screenReader, expectedCalls }) => {
|
||||
const writeSpy = vi
|
||||
.spyOn(process.stdout, 'write')
|
||||
.mockImplementation(() => true);
|
||||
const mockConfigWithScreenReader = {
|
||||
...mockConfig,
|
||||
getScreenReader: () => screenReader,
|
||||
} as Config;
|
||||
|
||||
const mockInitializationResult = {
|
||||
authError: null,
|
||||
themeError: null,
|
||||
shouldOpenAuthDialog: false,
|
||||
geminiMdFileCount: 0,
|
||||
};
|
||||
|
||||
await startInteractiveUI(
|
||||
mockConfigWithScreenReader,
|
||||
mockSettings,
|
||||
mockStartupWarnings,
|
||||
mockWorkspaceRoot,
|
||||
mockInitializationResult,
|
||||
);
|
||||
|
||||
if (expectedCalls.length > 0) {
|
||||
expect(writeSpy).toHaveBeenCalledWith(expectedCalls[0][0]);
|
||||
} else {
|
||||
expect(writeSpy).not.toHaveBeenCalledWith('\x1b[?7l');
|
||||
}
|
||||
writeSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user