Skip to content

Commit

Permalink
test(libs-utils): add more tests to improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
waddaboo committed Jul 4, 2024
1 parent 24df00b commit 0ee28f3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions libs/utils/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { blockchainCredentialSupportedNetworks } from "./getSupportedNetworks"
import shortenAddress from "./shortenAddress"

describe("Utils", () => {
Expand All @@ -10,4 +11,30 @@ describe("Utils", () => {
expect(address).toBe("0x1234...7890")
})
})

describe("# blockchainCredentialSupportedNetworks", () => {
it("Should return a list of blockchain credential supported network", () => {
const networks = blockchainCredentialSupportedNetworks

expect(networks).toHaveLength(
blockchainCredentialSupportedNetworks.length
)
})

it("Should return a blockchain credential supported network", () => {
const expected = {
id: "sepolia",
name: "Sepolia"
}
const id = blockchainCredentialSupportedNetworks.find(
(i) => i.id === expected.id
)
const name = blockchainCredentialSupportedNetworks.find(
(i) => i.name === expected.name
)

expect(id).toMatchObject(expected)
expect(name).toMatchObject(expected)
})
})
})

0 comments on commit 0ee28f3

Please sign in to comment.