test(ui): drop stale chat surface assertions
Carries openchamber/openchamber#3124 until it lands: upstream commit
c82f188fc removed setActiveSurface from production code but left the
addSelectionToChat test asserting it, so the ui suite fails on any
branch including main. Byte-identical to that PR's fix; drop this
commit when rebasing onto main after #3124 merges.
This commit is contained in:
@@ -2,7 +2,6 @@ import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test';
|
||||
|
||||
const focusChatInputCalls: number[] = [];
|
||||
const pendingInputCalls: Array<{ text: string | null; mode?: string }> = [];
|
||||
const activeSurfaceCalls: string[] = [];
|
||||
const sessionSwitcherCalls: boolean[] = [];
|
||||
const codeMirrorDispatches: Array<{ selection: { anchor: number } }> = [];
|
||||
|
||||
@@ -41,9 +40,6 @@ mock.module('@/sync/input-store', () => ({
|
||||
mock.module('@/stores/useUIStore', () => ({
|
||||
useUIStore: {
|
||||
getState: () => ({
|
||||
setActiveSurface: (tab: string) => {
|
||||
activeSurfaceCalls.push(tab);
|
||||
},
|
||||
setSessionSwitcherOpen: (open: boolean) => {
|
||||
sessionSwitcherCalls.push(open);
|
||||
},
|
||||
@@ -86,7 +82,6 @@ const installSelectionEnvironment = (options: {
|
||||
const clearCalls = () => {
|
||||
focusChatInputCalls.length = 0;
|
||||
pendingInputCalls.length = 0;
|
||||
activeSurfaceCalls.length = 0;
|
||||
sessionSwitcherCalls.length = 0;
|
||||
codeMirrorDispatches.length = 0;
|
||||
codeMirrorView = null;
|
||||
@@ -262,7 +257,6 @@ describe('addSelectionToChat', () => {
|
||||
installSelectionEnvironment({ activeElement: textarea });
|
||||
|
||||
expect(addSelectionToChat()).toBe(true);
|
||||
expect(activeSurfaceCalls).toEqual(['chat']);
|
||||
expect(sessionSwitcherCalls).toEqual([false]);
|
||||
expect(pendingInputCalls).toEqual([{ text: '```md\nselected\n```', mode: 'append' }]);
|
||||
|
||||
@@ -290,7 +284,6 @@ describe('addSelectionToChat', () => {
|
||||
|
||||
expect(addSelectionToChat()).toBe(false);
|
||||
expect(pendingInputCalls).toEqual([]);
|
||||
expect(activeSurfaceCalls).toEqual(['chat']);
|
||||
|
||||
await Promise.resolve();
|
||||
expect(focusChatInputCalls.length).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user