Skip to content

Commit

Permalink
Add emulator/local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Feb 8, 2024
1 parent 7aaba16 commit 41b1043
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions helpers/__tests__/paths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ describe('paths helpers: createPathFromArray', () => {
const arrThree = ['testnet', 'authn']
const arrFour = ['canarynet', 'authn']
const arrFive = ['crescendo', 'authn']
const arrSix= ['local', 'authn']
const arrSeven = ['emulator', 'authn']

const expectedResponseOne = '/authn'
const expectedResponseTwo = '/mainnet/authn'
const expectedResponseThree = '/testnet/authn'
const expectedResponseFour = '/canarynet/authn'
const expectedResponseFive = '/crescendo/authn'
const expectedResponseSix = '/local/authn'
const expectedResponseSeven = '/emulator/authn'

expect(createPathFromArray(arrOne)).toEqual(expectedResponseOne)
expect(createPathFromArray(arrTwo)).toEqual(expectedResponseTwo)
expect(createPathFromArray(arrThree)).toEqual(expectedResponseThree)
expect(createPathFromArray(arrFour)).toEqual(expectedResponseFour)
expect(createPathFromArray(arrFive)).toEqual(expectedResponseFive)
expect(createPathFromArray(arrSix)).toEqual(expectedResponseSix)
expect(createPathFromArray(arrSeven)).toEqual(expectedResponseSeven)
})
})

Expand All @@ -30,13 +36,17 @@ describe('paths helpers: isValidPath', () => {
const pathFour = ['canarynet', 'authn']
const pathFive = ['foo', 'bar']
const pathSix = ['crescendo', 'authn']
const pathSeven = ['local', 'authn']
const pathEight = ['emulator', 'authn']

expect(isValidPath(pathOne)).toBe(true)
expect(isValidPath(pathTwo)).toBe(true)
expect(isValidPath(pathThree)).toBe(true)
expect(isValidPath(pathFour)).toBe(true)
expect(isValidPath(pathFive)).toBe(false)
expect(isValidPath(pathSix)).toBe(true)
expect(isValidPath(pathSeven)).toBe(true)
expect(isValidPath(pathEight)).toBe(true)
expect(isValidPath(null)).toBe(false)
})
})
Expand Down

0 comments on commit 41b1043

Please sign in to comment.