Skip to content

Commit cf36482

Browse files
test: tighten default token path tests per code review
- Remove redundant Array.isArray assertion (length check is sufficient) - Assert mockFetch was not called to make the contract of the 'default' path explicit and guard against future regressions
1 parent 8856a10 commit cf36482

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/hooks/useTokenLists.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ describe('fetchTokenList', () => {
160160
it('returns a non-empty tokens array', async () => {
161161
const result = await fetchTokenList('default')
162162

163-
expect(Array.isArray(result.tokens)).toBe(true)
164163
expect(result.tokens.length).toBeGreaterThan(0)
164+
expect(mockFetch).not.toHaveBeenCalled()
165165
})
166166

167167
it('every EVM token conforms to tokenSchema', async () => {
@@ -175,6 +175,7 @@ describe('fetchTokenList', () => {
175175
for (const token of evmTokens) {
176176
expect(() => tokenSchema.parse(token)).not.toThrow()
177177
}
178+
expect(mockFetch).not.toHaveBeenCalled()
178179
})
179180
})
180181
})

0 commit comments

Comments
 (0)