Skip to content

Commit 76f1969

Browse files
Copilothotlong
andcommitted
refactor: address code review feedback - improve test clarity
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 45f0f7e commit 76f1969

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

apps/console/src/__tests__/MSWServer.test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,16 @@ describe('MSW Server Integration', () => {
109109

110110
// Seed data defines _id "101" for the first opportunity.
111111
// After syncDriverIds, id must equal _id (both "101").
112-
const first = opportunities.find((r: any) => r._id === '101');
113-
expect(first).toBeDefined();
114-
expect(first.id).toBe('101');
115-
expect(first._id).toBe('101');
112+
const targetOpportunity = opportunities.find((r: any) => r._id === '101');
113+
expect(targetOpportunity).toBeDefined();
114+
expect(targetOpportunity.id).toBe('101');
115+
expect(targetOpportunity._id).toBe('101');
116116
});
117117

118118
it('should fetch a seed record by _id via HTTP', async () => {
119-
// GET /data/opportunity/101 — uses the stable seed _id
119+
// GET /data/opportunity/101 — uses the stable seed _id.
120+
// Response may be wrapped in { success, data: { record } } (HttpDispatcher)
121+
// or returned as { record } (direct protocol).
120122
const res = await fetch('http://localhost/api/v1/data/opportunity/101');
121123
expect(res.ok).toBe(true);
122124
const body = await res.json();

0 commit comments

Comments
 (0)