Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #901 from juan-cortes/swap-historytestcross
Browse files Browse the repository at this point in the history
Fix broken tests for swap history export cross
  • Loading branch information
gre authored Oct 5, 2020
2 parents 2be87fa + ef1af35 commit 10b042c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/cross.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Object {
"index": 1,
"name": "qfLJHUiyMqUUN",
"seedIdentifier": "mock",
"swapHistory": Array [],
},
Object {
"balance": "53736258",
Expand All @@ -23,7 +22,6 @@ Object {
"index": 1,
"name": "Y4SYkWgSWIIZptphvAu",
"seedIdentifier": "mock",
"swapHistory": Array [],
},
Object {
"balance": "128088571428550",
Expand All @@ -34,7 +32,6 @@ Object {
"index": 1,
"name": "s9dZEiOrwfEPOXbKgNKq88aQZ",
"seedIdentifier": "mock",
"swapHistory": Array [],
},
],
"meta": Object {
Expand Down
22 changes: 0 additions & 22 deletions src/__tests__/cross.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,6 @@ test("encode/decode", () => {
expect(exp.accounts).toMatchObject(data.accounts.map(accountToAccountData));
});

test("encode/decode swapHistory", () => {
const accountWithHistory = genAccount("account_with_swapHistory", {
swapHistorySize: 2,
});
const data = accountToAccountData(accountWithHistory);
const res = accountToAccountData(accountDataToAccount(data));
expect(res).toMatchObject(data);
expect(res.swapHistory?.length).toBe(2);
});

test("encode/decode swapHistory resilience", () => {
// swapHistory should be added even if the source doesn't have it
const accountWithoutHistory = genAccount("account_without_swapHistory");
// $FlowFixMe
accountWithoutHistory.swapHistory = undefined;
const data = accountToAccountData(accountWithoutHistory);
const res = accountToAccountData(accountDataToAccount(data));

expect(res).toMatchObject(data);
expect(res.swapHistory?.length).toBe(0);
});

test("encode/decode", () => {
const accounts = Array(3)
.fill(null)
Expand Down

1 comment on commit 10b042c

@vercel
Copy link

@vercel vercel bot commented on 10b042c Oct 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.