Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee77e1236e |
@@ -46,9 +46,9 @@ async function readChain(wallets) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boots the popup over a profile with one wallet. From then on, a refresh the
|
// Boots the popup over a profile with one wallet. From then on,
|
||||||
// test does not answer never returns. So a refresh that starts another on its
|
// `refreshBalances()` never returns unless the test answers it. So an unwanted
|
||||||
// own is counted and stops, rather than running forever.
|
// refresh is counted once and then waits, instead of starting more.
|
||||||
async function boot() {
|
async function boot() {
|
||||||
const page = await bootPopup(unversionedValidProfile());
|
const page = await bootPopup(unversionedValidProfile());
|
||||||
expect(page.pageErrors).toEqual([]);
|
expect(page.pageErrors).toEqual([]);
|
||||||
@@ -111,7 +111,7 @@ async function importKey(page, key) {
|
|||||||
await page.click("btn-add-wallet-confirm");
|
await page.click("btn-add-wallet-confirm");
|
||||||
}
|
}
|
||||||
|
|
||||||
test("addresses an import finds while a refresh runs show their balances once one more refresh returns", async () => {
|
test("addresses that an import finds during a refresh show their balances once one more refresh returns", async () => {
|
||||||
const { page } = await boot();
|
const { page } = await boot();
|
||||||
const refresh = await holdRefresh(page);
|
const refresh = await holdRefresh(page);
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ test("addresses an import finds while a refresh runs show their balances once on
|
|||||||
expect(list).toContain("<span>3.0000</span>");
|
expect(list).toContain("<span>3.0000</span>");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("several refreshes asked for while one runs lead to exactly one more", async () => {
|
test("several requests during a refresh lead to exactly one more refresh", async () => {
|
||||||
const { page, refreshBalances } = await boot();
|
const { page, refreshBalances } = await boot();
|
||||||
const refresh = await holdRefresh(page);
|
const refresh = await holdRefresh(page);
|
||||||
const calls = refreshBalances.mock.calls.length;
|
const calls = refreshBalances.mock.calls.length;
|
||||||
@@ -143,7 +143,7 @@ test("several refreshes asked for while one runs lead to exactly one more", asyn
|
|||||||
expect(refreshBalances).toHaveBeenCalledTimes(calls + 1);
|
expect(refreshBalances).toHaveBeenCalledTimes(calls + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("a tick of the ten-second timer while a refresh runs queues no other refresh", async () => {
|
test("a tick of the ten-second timer during a refresh starts no other refresh", async () => {
|
||||||
const { page, refreshBalances } = await boot();
|
const { page, refreshBalances } = await boot();
|
||||||
const refresh = await holdRefresh(page);
|
const refresh = await holdRefresh(page);
|
||||||
const calls = refreshBalances.mock.calls.length;
|
const calls = refreshBalances.mock.calls.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user