feat(accessibility): implement centralized screen reader layout system (#8155)

This commit is contained in:
Victor Tsaran
2025-09-23 11:04:49 -07:00
committed by GitHub
parent f46e50b271
commit bfd904bfc8
10 changed files with 348 additions and 64 deletions
+40 -2
View File
@@ -32,6 +32,46 @@ vi.mock('./components/QuittingDisplay.js', () => ({
QuittingDisplay: () => <Text>Quitting...</Text>,
}));
vi.mock('./components/Footer.js', () => ({
Footer: () => <Text>Footer</Text>,
}));
vi.mock('./semantic-colors.js', () => ({
theme: {
status: {
warning: 'yellow',
},
},
}));
// Don't mock the layout components - let them render normally so tests can see the Ctrl messages
vi.mock('./hooks/useLayoutConfig.js', () => ({
useLayoutConfig: () => ({
mode: 'default',
shouldUseStatic: true,
shouldShowFooterInComposer: true,
}),
}));
vi.mock('./hooks/useFooterProps.js', () => ({
useFooterProps: () => ({
model: 'test-model',
targetDir: '/test',
debugMode: false,
branchName: 'test-branch',
debugMessage: '',
corgiMode: false,
errorCount: 0,
showErrorDetails: false,
showMemoryUsage: false,
promptTokenCount: 0,
nightly: false,
isTrustedFolder: true,
vimMode: undefined,
}),
}));
describe('App', () => {
const mockUIState: Partial<UIState> = {
streamingState: StreamingState.Idle,
@@ -55,7 +95,6 @@ describe('App', () => {
);
expect(lastFrame()).toContain('MainContent');
expect(lastFrame()).toContain('Notifications');
expect(lastFrame()).toContain('Composer');
});
@@ -87,7 +126,6 @@ describe('App', () => {
);
expect(lastFrame()).toContain('MainContent');
expect(lastFrame()).toContain('Notifications');
expect(lastFrame()).toContain('DialogManager');
});