test: the popup boot's stand-in for filterTransactions returns the real shape (closes #429)
The stand-in in tests/support/popupBoot.js returned a bare list, while the
real filterTransactions returns { transactions, newFraudContracts }. Home,
AddressDetail and AddressToken read both fields, so every test boot onto
one of them threw inside its transaction loading, logged loadHomeTxs failed
or loadTransactions failed, and never ran the rest of that code. The
stand-in now returns the real shape, and tests/persistedFieldContract.test.js
boots onto each of the three views and asserts neither message is logged.
Model: opus-5-5
This commit was merged in pull request #443.
This commit is contained in:
@@ -263,9 +263,12 @@ async function bootPopup(stored, options) {
|
||||
getProvider: () => ({}),
|
||||
scanForAddresses: jest.fn(async () => []),
|
||||
}));
|
||||
// filterTransactions() answers in the real one's shape: Home,
|
||||
// AddressDetail and AddressToken read both fields, and a bare list makes
|
||||
// their transaction loading throw into a catch that only logs.
|
||||
jest.doMock("../../src/shared/transactions", () => ({
|
||||
fetchRecentTransactions: jest.fn(async () => []),
|
||||
filterTransactions: () => [],
|
||||
filterTransactions: () => ({ transactions: [], newFraudContracts: [] }),
|
||||
}));
|
||||
|
||||
const storage =
|
||||
|
||||
Reference in New Issue
Block a user