Skip to content

Commit

Permalink
Add unit tests, begin migration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gambinish committed Sep 20, 2024
1 parent c9cecf2 commit c229c32
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
16 changes: 16 additions & 0 deletions app/scripts/migrations/128.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { migrate, version } from './128';

const oldVersion = 127;

describe(`migration #${version}`, () => {
it('updates the version metadata', async () => {
const oldStorage = {
meta: { version: oldVersion },
data: {},
};

const newStorage = await migrate(oldStorage);

expect(newStorage.meta).toStrictEqual({ version });
});
});
7 changes: 6 additions & 1 deletion test/data/mock-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,12 @@
"showTestNetworks": true,
"smartTransactionsOptInStatus": false,
"useNativeCurrencyAsPrimaryCurrency": true,
"petnamesEnabled": false
"petnamesEnabled": false,
"tokenSortConfig": {
"key": "tokenFiatAmount",
"order": "dsc",
"sortCallback": "stringNumeric"
}
},
"ensResolutionsByAddress": {},
"isAccountMenuOpen": false,
Expand Down
7 changes: 7 additions & 0 deletions ui/pages/routes/routes.component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ describe('Routes Component', () => {
announcements: {},
...mockNetworkState({ chainId: CHAIN_IDS.MAINNET }),
newPrivacyPolicyToastShownDate: new Date('0'),
preferences: {
tokenSortConfig: {
key: 'tokenFiatAmount',
order: 'dsc',
sortCallback: 'stringNumeric',
},
},
},
send: {
...mockSendState.send,
Expand Down

0 comments on commit c229c32

Please sign in to comment.