MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / simulateDetection

Function simulateDetection

cli/src/__tests__/home-directory-detection.test.ts:68–78  ·  view source on GitHub ↗
(
        fileTreeLoaded: boolean,
        fileTreeLength: number,
      )

Source from the content-addressed store, hash-verified

66 test('should only trigger when fileTreeLoaded is true AND fileTree is empty', () => {
67 // Simulate the detection logic from chat.tsx
68 const simulateDetection = (
69 fileTreeLoaded: boolean,
70 fileTreeLength: number,
71 ) => {
72 if (fileTreeLoaded && fileTreeLength === 0) {
73 useChatStore.getState().setActiveTopBanner('homeDir')
74 useChatStore.getState().setInputMode('homeDir')
75 return true
76 }
77 return false
78 }
79
80 // Reset state
81 useChatStore.getState().reset()

Calls

no outgoing calls

Tested by

no test coverage detected