diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index 91cce9868..fc2a79b7b 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -12,28 +12,40 @@ describe('Mainnet', () => { Cypress.Commands.add('waitForBlockData', () => { cy.wait('@tx-outspends'); cy.wait('@pools'); - }); + }); }); it('loads the status screen', () => { - cy.visit('/status'); - cy.get('#mempool-block-0').should('be.visible'); - cy.get('[id^="bitcoin-block-"]').should('have.length', 8); - cy.get('.footer').should('be.visible'); - cy.get('.row > :nth-child(1)').invoke('text').then((text) => { - expect(text).to.match(/Tx vBytes per second:.* vB\/s/); - }); - cy.get('.row > :nth-child(2)').invoke('text').then((text) => { - expect(text).to.match(/Unconfirmed:(.*)/); - }); - cy.get('.row > :nth-child(3)').invoke('text').then((text) => { - expect(text).to.match(/Mempool size:(.*) (kB|MB) \((\d+) (block|blocks)\)/); - }); + cy.visit('/status'); + cy.get('#mempool-block-0').should('be.visible'); + cy.get('[id^="bitcoin-block-"]').should('have.length', 8); + cy.get('.footer').should('be.visible'); + cy.get('.row > :nth-child(1)').invoke('text').then((text) => { + expect(text).to.match(/Tx vBytes per second:.* vB\/s/); + }); + cy.get('.row > :nth-child(2)').invoke('text').then((text) => { + expect(text).to.match(/Unconfirmed:(.*)/); + }); + cy.get('.row > :nth-child(3)').invoke('text').then((text) => { + expect(text).to.match(/Mempool size:(.*) (kB|MB) \((\d+) (block|blocks)\)/); + }); }); + it('loads the dashboard', () => { - cy.visit('/'); - cy.waitForSkeletonGone(); + cy.visit('/'); + cy.waitForSkeletonGone(); + }); + + it('loads skeleton when changes between networks', () => { + cy.visit('/'); + cy.waitForSkeletonGone(); + + cy.changeNetwork("testnet"); + cy.changeNetwork("signet"); + cy.changeNetwork("liquid"); + cy.changeNetwork("mainnet"); + cy.changeNetwork("bisq"); }); it('loads the dashboard with the skeleton blocks', () => { diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 96e2270fe..b240a7bc4 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -64,3 +64,14 @@ Cypress.Commands.add( Cypress.Commands.add('mockMempoolSocket', () => { mockWebSocket(); }); + +Cypress.Commands.add('changeNetwork', (network: "testnet"|"signet"|"liquid"|"bisq"|"mainnet" ) => { + cy.get('.dropdown-toggle').click().then(() => { + cy.get(`.${network}`).click().then(() => { + cy.waitForPageIdle(); + if(network !== 'bisq'){ + cy.waitForSkeletonGone(); + } + }); + }); +}); diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html index dd74114c2..ab2ffbe65 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html @@ -1,4 +1,4 @@ -