Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Jan 8, 2025
1 parent 89906f3 commit 75108d4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion apps/web/src/utils/__tests__/chains.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,34 @@ describe('chains', () => {
describe('chains', () => {
describe('getLatestSafeVersion', () => {
it('should return the version from recommendedMasterCopyVersion', () => {
expect(
getLatestSafeVersion(
chainBuilder().with({ chainId: '1', recommendedMasterCopyVersion: '1.4.1' }).build(),
true,
),
).toEqual('1.4.1')
expect(
getLatestSafeVersion(
chainBuilder().with({ chainId: '137', recommendedMasterCopyVersion: '1.3.0' }).build(),
true,
),
).toEqual('1.3.0')
})

it('should always return LATEST_VERSION if true is not passed', () => {
expect(
getLatestSafeVersion(chainBuilder().with({ chainId: '1', recommendedMasterCopyVersion: '1.4.1' }).build()),
).toEqual('1.4.1')
expect(
getLatestSafeVersion(chainBuilder().with({ chainId: '137', recommendedMasterCopyVersion: '1.3.0' }).build()),
).toEqual('1.3.0')
).toEqual('1.4.1')
})

it('should fall back to LATEST_VERSION', () => {
expect(
getLatestSafeVersion(
chainBuilder().with({ chainId: '11155111', recommendedMasterCopyVersion: null }).build(),
true,
),
).toEqual('1.4.1')
})
Expand Down

0 comments on commit 75108d4

Please sign in to comment.