Skip to content

Commit

Permalink
feat(jest): 100% coverage for mock/wallet.ts (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
drepram authored Mar 22, 2022
1 parent f147301 commit 9f80cea
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
93 changes: 93 additions & 0 deletions mock/tests/__snapshots__/wallet.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`init gets the Details constant 1`] = `
Object {
"balance": 328000,
"currency": "usd",
"last_update": 1633500930632,
}
`;

exports[`init gets the LinkedAccounts constant 1`] = `
Array [
Object {
"icon": "credit-card",
"name": "Discover Debit",
"number": "8312",
"type": "credit-card",
},
Object {
"icon": "credit-card",
"name": "PNC Credit",
"number": "1234",
"type": "debit-card",
},
Object {
"icon": "binary",
"name": "Ledger Nano",
"number": "0000",
"type": "hardware",
},
]
`;

exports[`init gets the RecentTransactions constant 1`] = `
Array [
Object {
"amount": 3000,
"at": 1633500930632,
"direction": "out",
"id": "12345",
"memo": "Computer Game.",
"state": "sent",
"user": Object {
"address": "0x07ee55aa48bb72dcc6e9d88856648910de513eca",
"name": "James Lightspeed",
},
},
Object {
"amount": 82000,
"at": 1633500930632,
"id": "asdfewr21",
"memo": "Thanks for lunch.",
"state": "received",
"user": Object {
"address": "0x9bf4001de07dfd62b26a2f1307ee0c0307632d59",
"name": "Derek Wormhole",
},
},
Object {
"amount": 2000,
"at": 1633500930632,
"id": "1288roq",
"memo": "",
"state": "requested",
"user": Object {
"address": "0x9bf4001de07dfd62b26a2f1307ee0c0307632d59",
"name": "Derek Wormhole",
},
},
Object {
"amount": 9000,
"at": 1633500930632,
"id": "12i9qwe",
"memo": "",
"state": "sent",
"user": Object {
"address": "0xdc76cd25977e015ae17155770273ad58648913d3",
"name": "Frank Meteor",
},
},
Object {
"amount": 39000,
"at": 1633500930632,
"id": "npqw012",
"memo": "",
"state": "sent",
"user": Object {
"address": "0xdc76cd25977e015ae17155770273ad58648913d3",
"name": "Frank Meteor",
},
},
]
`;
13 changes: 13 additions & 0 deletions mock/tests/wallet.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Wallet from '../wallet'

describe('init', () => {
it('gets the Details constant', () => {
expect(Wallet.Details).toMatchSnapshot()
})
it('gets the LinkedAccounts constant', () => {
expect(Wallet.LinkedAccounts).toMatchSnapshot()
})
it('gets the RecentTransactions constant', () => {
expect(Wallet.RecentTransactions).toMatchSnapshot()
})
})

0 comments on commit 9f80cea

Please sign in to comment.