Fix concurrent asynchronous calls. (#675)

* Fix concurrent asynchronous calls.

* Remove test without mempool info websocket.

* Remove isloading$ variable.
This commit is contained in:
Miguel Medeiros
2021-07-31 13:40:15 -03:00
committed by GitHub
parent 837e714b1f
commit 8b0d1db776
10 changed files with 24 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
import { emitMempoolInfo } from "../../support/websocket";
import { emitMempoolInfo, emitWithoutMempoolInfo } from "../../support/websocket";
describe('Mainnet', () => {
beforeEach(() => {
@@ -51,6 +51,7 @@ describe('Mainnet', () => {
loaded: true
}
});
cy.get(':nth-child(1) > #bitcoin-block-0').should('not.exist');
cy.get(':nth-child(2) > #bitcoin-block-0').should('not.exist');
cy.get(':nth-child(3) > #bitcoin-block-0').should('not.exist');

View File

@@ -70,15 +70,15 @@ export const emitMempoolInfo = ({
default:
win.mockSocket.send('{"action":"init"}');
win.mockSocket.send('{"action":"want","data":["blocks","stats","mempool-blocks","live-2h-chart"]}');
cy.readFile('cypress/fixtures/mainnet_mempoolInfo.json', 'ascii').then((fixture) => {
win.mockSocket.send(JSON.stringify(fixture));
});
win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}');
cy.readFile('cypress/fixtures/mainnet_live2hchart.json', 'ascii').then((fixture) => {
win.mockSocket.send(JSON.stringify(fixture));
});
cy.readFile('cypress/fixtures/mainnet_mempoolInfo.json', 'ascii').then((fixture) => {
win.mockSocket.send(JSON.stringify(fixture));
});
}
});
cy.waitForSkeletonGone();
return cy.get('#mempool-block-0');
};
};