Skip to content

Commit

Permalink
Add TACo app to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
theref committed Oct 12, 2023
1 parent 510ebac commit 5e05a15
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/utils/__tests__/getStakingAppLabel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,48 @@ import { getThresholdLib } from "../getThresholdLib"
const MOCK_ADDRESSES: Record<StakingAppName, string> = {
tbtc: getThresholdLib().multiAppStaking.ecdsa.address,
randomBeacon: getThresholdLib().multiAppStaking.randomBeacon.address,
taco: getThresholdLib().multiAppStaking.taco.address,
}
const MOCK_LABELS: Record<StakingAppName, string> = {
tbtc: "tBTC",
randomBeacon: "Random Beacon",
taco: "TACo",
}
const MOCK_APP_NAMES: StakingAppName[] = ["tbtc", "randomBeacon"]
const MOCK_APP_NAMES: StakingAppName[] = ["tbtc", "randomBeacon", "taco"]

describe("Staking app label utils tests", () => {
const [tbtcName, rbName] = MOCK_APP_NAMES
const [tbtcName, rbName, tacoName] = MOCK_APP_NAMES
const tbtcAddress = MOCK_ADDRESSES[tbtcName]
const rbAddress = MOCK_ADDRESSES[rbName]
const tacoAddress = MOCK_ADDRESSES[tacoName]

it("returns correct app label if app address is given", () => {
const resultTbtcLabel = getStakingAppLabelFromAppAddress(tbtcAddress)
const resultRbLabel = getStakingAppLabelFromAppAddress(rbAddress)
const resultTacoLabel = getStakingAppLabelFromAppAddress(tacoAddress)

expect(resultTbtcLabel).toBe(MOCK_LABELS[tbtcName])
expect(resultRbLabel).toBe(MOCK_LABELS[rbName])
expect(resultTacoLabel).toBe(MOCK_LABELS[tacoName])
})

it("returns correct app label if app name is given", () => {
const resultTbtcLabel = getStakingAppLabelFromAppName(tbtcName)
const resultRbLabel = getStakingAppLabelFromAppName(rbName)
const resultTacoLabel = getStakingAppLabelFromAppName(tacoName)

expect(resultTbtcLabel).toBe(MOCK_LABELS[tbtcName])
expect(resultRbLabel).toBe(MOCK_LABELS[rbName])
expect(resultTacoLabel).toBe(MOCK_LABELS[tacoName])
})

it("returns correct app name if address is given", () => {
const resultTbtcName = getStakingAppNameFromAppAddress(tbtcAddress)
const resultRbName = getStakingAppNameFromAppAddress(rbAddress)
const resultTacoName = getStakingAppNameFromAppAddress(tacoAddress)

expect(resultTbtcName).toBe(tbtcName)
expect(resultRbName).toBe(rbName)
expect(resultTacoName).toBe(tacoName)
})
})

0 comments on commit 5e05a15

Please sign in to comment.