Skip to content

Commit 199bab2

Browse files
fix tests
1 parent 80f803b commit 199bab2

2 files changed

Lines changed: 50 additions & 50 deletions

File tree

packages/web/src/features/chat/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ test('getAnswerPartFromAssistantMessage returns text part when it starts with AN
167167

168168
expect(result).toEqual({
169169
type: 'text',
170-
text: `${ANSWER_TAG}This is the answer to your question.`
170+
text: `This is the answer to your question.`
171171
});
172172
});
173173

@@ -190,7 +190,7 @@ test('getAnswerPartFromAssistantMessage returns text part when it starts with AN
190190

191191
expect(result).toEqual({
192192
type: 'text',
193-
text: `${ANSWER_TAG}This is the answer to your question.`
193+
text: `This is the answer to your question.`
194194
});
195195
});
196196

packages/web/src/features/git/listCommitsApi.test.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ describe('searchCommits', () => {
191191
});
192192

193193
expect(mockGitLog).toHaveBeenCalledWith(
194-
expect.objectContaining({
195-
'--since': '2024-01-01',
196-
'--until': '2024-12-31',
197-
})
194+
expect.arrayContaining([
195+
'--since=2024-01-01',
196+
'--until=2024-12-31',
197+
])
198198
);
199199
});
200200
});
@@ -211,10 +211,10 @@ describe('searchCommits', () => {
211211
});
212212

213213
expect(mockGitLog).toHaveBeenCalledWith(
214-
expect.objectContaining({
215-
maxCount: 50,
216-
HEAD: null,
217-
})
214+
expect.arrayContaining([
215+
'--max-count=50',
216+
'HEAD',
217+
])
218218
);
219219
});
220220

@@ -225,10 +225,10 @@ describe('searchCommits', () => {
225225
});
226226

227227
expect(mockGitLog).toHaveBeenCalledWith(
228-
expect.objectContaining({
229-
maxCount: 100,
230-
HEAD: null,
231-
})
228+
expect.arrayContaining([
229+
'--max-count=100',
230+
'HEAD',
231+
])
232232
);
233233
});
234234

@@ -239,10 +239,10 @@ describe('searchCommits', () => {
239239
});
240240

241241
expect(mockGitLog).toHaveBeenCalledWith(
242-
expect.objectContaining({
243-
'--since': '30 days ago',
244-
HEAD: null,
245-
})
242+
expect.arrayContaining([
243+
'--since=30 days ago',
244+
'HEAD',
245+
])
246246
);
247247
});
248248

@@ -253,10 +253,10 @@ describe('searchCommits', () => {
253253
});
254254

255255
expect(mockGitLog).toHaveBeenCalledWith(
256-
expect.objectContaining({
257-
'--until': 'yesterday',
258-
HEAD: null,
259-
})
256+
expect.arrayContaining([
257+
'--until=yesterday',
258+
'HEAD',
259+
])
260260
);
261261
});
262262

@@ -267,11 +267,11 @@ describe('searchCommits', () => {
267267
});
268268

269269
expect(mockGitLog).toHaveBeenCalledWith(
270-
expect.objectContaining({
271-
'--author': 'john@example.com',
272-
'--regexp-ignore-case': null,
273-
HEAD: null,
274-
})
270+
expect.arrayContaining([
271+
'--author=john@example.com',
272+
'--regexp-ignore-case',
273+
'HEAD',
274+
])
275275
);
276276
});
277277

@@ -282,11 +282,11 @@ describe('searchCommits', () => {
282282
});
283283

284284
expect(mockGitLog).toHaveBeenCalledWith(
285-
expect.objectContaining({
286-
'--grep': 'fix bug',
287-
'--regexp-ignore-case': null,
288-
HEAD: null,
289-
})
285+
expect.arrayContaining([
286+
'--grep=fix bug',
287+
'--regexp-ignore-case',
288+
'HEAD',
289+
])
290290
);
291291
});
292292

@@ -300,15 +300,15 @@ describe('searchCommits', () => {
300300
maxCount: 25,
301301
});
302302

303-
expect(mockGitLog).toHaveBeenCalledWith({
304-
maxCount: 25,
305-
HEAD: null,
306-
'--since': '2024-01-01',
307-
'--until': '2024-12-31',
308-
'--author': 'jane@example.com',
309-
'--regexp-ignore-case': null,
310-
'--grep': 'feature',
311-
});
303+
expect(mockGitLog).toHaveBeenCalledWith([
304+
'--max-count=25',
305+
'--since=2024-01-01',
306+
'--until=2024-12-31',
307+
'--author=jane@example.com',
308+
'--regexp-ignore-case',
309+
'--grep=feature',
310+
'HEAD',
311+
]);
312312
});
313313
});
314314

@@ -478,15 +478,15 @@ describe('searchCommits', () => {
478478
});
479479

480480
expect(result).toEqual({ commits: mockCommits, totalCount: 1 });
481-
expect(mockGitLog).toHaveBeenCalledWith({
482-
maxCount: 20,
483-
HEAD: null,
484-
'--since': '30 days ago',
485-
'--until': 'yesterday',
486-
'--author': 'security',
487-
'--regexp-ignore-case': null,
488-
'--grep': 'authentication',
489-
});
481+
expect(mockGitLog).toHaveBeenCalledWith([
482+
'--max-count=20',
483+
'--since=30 days ago',
484+
'--until=yesterday',
485+
'--author=security',
486+
'--regexp-ignore-case',
487+
'--grep=authentication',
488+
'HEAD',
489+
]);
490490
});
491491

492492
it('should handle repository not found in database', async () => {

0 commit comments

Comments
 (0)