Skip to content

Commit 1ec543c

Browse files
committed
Fix the integration test
1 parent 61d0234 commit 1ec543c

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

package-lock.json

Lines changed: 2 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/src/test/codewhispererChat/tools/grepSearch.test.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ describe('GrepSearch', () => {
190190
it('should write updates to the provided stream', async () => {
191191
await grepSearch.invoke(mockUpdates)
192192

193-
// eslint-disable-next-line @typescript-eslint/unbound-method
194-
sinon.assert.calledWith(mockUpdates.write as sinon.SinonSpy, '\n\n5 matches found:\n\n')
195193
// eslint-disable-next-line @typescript-eslint/unbound-method
196194
sinon.assert.calledWith(mockUpdates.write as sinon.SinonSpy, 'processed-results')
197195
})
@@ -248,23 +246,20 @@ describe('GrepSearch', () => {
248246

249247
assert.strictEqual(totalMatchCount, 3)
250248

251-
// Check that output contains details tags
252-
assert.ok(sanitizedOutput.includes('<details>'))
253-
assert.ok(sanitizedOutput.includes('</details>'))
254-
255-
// Check that output contains file names
256-
assert.ok(sanitizedOutput.includes('file1.ts - match count: (2)'))
257-
assert.ok(sanitizedOutput.includes('file2.ts - match count: (1)'))
249+
// Check that output contains the title
250+
assert.ok(sanitizedOutput.includes('## Grepped result'))
258251

259-
// Check that output contains line numbers as links
260-
assert.ok(sanitizedOutput.includes('[Line 10]'))
261-
assert.ok(sanitizedOutput.includes('[Line 20]'))
262-
assert.ok(sanitizedOutput.includes('[Line 5]'))
252+
// Check that output contains file names as links
253+
assert.ok(sanitizedOutput.includes('[file1.ts]'))
254+
assert.ok(sanitizedOutput.includes('[file2.ts]'))
263255

264256
// Check that files are sorted by match count (most matches first)
265257
const file1Index = sanitizedOutput.indexOf('file1.ts')
266258
const file2Index = sanitizedOutput.indexOf('file2.ts')
267259
assert.ok(file1Index < file2Index, 'Files should be sorted by match count')
260+
261+
// Check that output contains search query in the URL
262+
assert.ok(sanitizedOutput.includes('search=test-query'))
268263
})
269264

270265
it('should handle malformed output lines', () => {

0 commit comments

Comments
 (0)