diff --git a/frontend/cypress/e2e/liquid/liquid.spec.ts b/frontend/cypress/e2e/liquid/liquid.spec.ts index 8548059bb..b355af0d2 100644 --- a/frontend/cypress/e2e/liquid/liquid.spec.ts +++ b/frontend/cypress/e2e/liquid/liquid.spec.ts @@ -45,6 +45,7 @@ describe('Liquid', () => { it('loads a specific block page', () => { cy.visit(`${basePath}/block/7e1369a23a5ab861e7bdede2aadcccae4ea873ffd9caf11c7c5541eb5bcdff54`); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); }); diff --git a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts index a96b0700c..5822540ff 100644 --- a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts +++ b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts @@ -47,6 +47,7 @@ describe('Liquid Testnet', () => { it('loads a specific block page', () => { cy.visit(`${basePath}/block/7e1369a23a5ab861e7bdede2aadcccae4ea873ffd9caf11c7c5541eb5bcdff54`); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); }); diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts index 5032144f8..edceeecf4 100644 --- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts +++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts @@ -103,6 +103,7 @@ describe('Mainnet', () => { it('check op_return tx tooltip', () => { cy.visit('/block/00000000000000000003c5f542bed265319c6cf64238cf1f1bb9bca3ebf686d2'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('onmouseover'); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('mouseenter'); @@ -111,6 +112,7 @@ describe('Mainnet', () => { it('check op_return coinbase tooltip', () => { cy.visit('/block/00000000000000000003c5f542bed265319c6cf64238cf1f1bb9bca3ebf686d2'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('onmouseover'); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('mouseenter'); @@ -283,6 +285,7 @@ describe('Mainnet', () => { it('loads genesis block and keypress arrow right', () => { cy.viewport('macbook-16'); cy.visit('/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); @@ -295,6 +298,7 @@ describe('Mainnet', () => { it('loads genesis block and keypress arrow left', () => { cy.viewport('macbook-16'); cy.visit('/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); @@ -323,6 +327,7 @@ describe('Mainnet', () => { it('loads genesis block and click on the arrow left', () => { cy.viewport('macbook-16'); cy.visit('/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); @@ -439,6 +444,7 @@ describe('Mainnet', () => { describe('blocks', () => { it('shows empty blocks properly', () => { cy.visit('/block/0000000000000000000bd14f744ef2e006e61c32214670de7eb891a5732ee775'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); cy.get('h2').invoke('text').should('equal', '1 transaction'); @@ -446,6 +452,7 @@ describe('Mainnet', () => { it('expands and collapses the block details', () => { cy.visit('/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); cy.get('.btn.btn-outline-info').click().then(() => { @@ -458,6 +465,7 @@ describe('Mainnet', () => { }); it('shows blocks with no pagination', () => { cy.visit('/block/00000000000000000001ba40caf1ad4cec0ceb77692662315c151953bfd7c4c4'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); cy.get('.block-tx-title h2').invoke('text').should('equal', '19 transactions'); @@ -467,6 +475,7 @@ describe('Mainnet', () => { it('supports pagination on the block screen', () => { // 41 txs cy.visit('/block/00000000000000000009f9b7b0f63ad50053ad12ec3b7f5ca951332f134f83d8'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('.pagination-container a').invoke('text').then((text1) => { cy.get('.active + li').first().click().then(() => { @@ -482,6 +491,7 @@ describe('Mainnet', () => { it('shows blocks pagination with 5 pages (desktop)', () => { cy.viewport(760, 800); cy.visit('/block/000000000000000000049281946d26fcba7d99fdabc1feac524bc3a7003d69b3').then(() => { + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); }); @@ -493,6 +503,7 @@ describe('Mainnet', () => { it('shows blocks pagination with 3 pages (mobile)', () => { cy.viewport(669, 800); cy.visit('/block/000000000000000000049281946d26fcba7d99fdabc1feac524bc3a7003d69b3').then(() => { + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.waitForPageIdle(); }); diff --git a/frontend/cypress/e2e/signet/signet.spec.ts b/frontend/cypress/e2e/signet/signet.spec.ts index 03cfb3480..11c47d14d 100644 --- a/frontend/cypress/e2e/signet/signet.spec.ts +++ b/frontend/cypress/e2e/signet/signet.spec.ts @@ -95,12 +95,14 @@ describe('Signet', () => { describe('blocks', () => { it('shows empty blocks properly', () => { cy.visit('/signet/block/00000133d54e4589f6436703b067ec23209e0a21b8a9b12f57d0592fd85f7a42'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('h2').invoke('text').should('equal', '1 transaction'); }); it('expands and collapses the block details', () => { cy.visit('/signet/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('.btn.btn-outline-info').click().then(() => { cy.get('#details').should('be.visible'); @@ -113,6 +115,7 @@ describe('Signet', () => { it('shows blocks with no pagination', () => { cy.visit('/signet/block/00000078f920a96a69089877b934ce7fd009ab55e3170920a021262cb258e7cc'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('h2').invoke('text').should('equal', '13 transactions'); cy.get('ul.pagination').first().children().should('have.length', 5); @@ -121,6 +124,7 @@ describe('Signet', () => { it('supports pagination on the block screen', () => { // 43 txs cy.visit('/signet/block/00000094bd52f73bdbfc4bece3a94c21fec2dc968cd54210496e69e4059d66a6'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('.header-bg.box > a').invoke('text').then((text1) => { cy.get('.active + li').first().click().then(() => { diff --git a/frontend/cypress/e2e/testnet4/testnet4.spec.ts b/frontend/cypress/e2e/testnet4/testnet4.spec.ts index 4e2b6e3fa..c67d2414b 100644 --- a/frontend/cypress/e2e/testnet4/testnet4.spec.ts +++ b/frontend/cypress/e2e/testnet4/testnet4.spec.ts @@ -95,12 +95,14 @@ describe('Testnet4', () => { describe('blocks', () => { it('shows empty blocks properly', () => { cy.visit('/testnet4/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('h2').invoke('text').should('equal', '1 transaction'); }); it('expands and collapses the block details', () => { cy.visit('/testnet4/block/0'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('.btn.btn-outline-info').click().then(() => { cy.get('#details').should('be.visible'); @@ -113,6 +115,7 @@ describe('Testnet4', () => { it('shows blocks with no pagination', () => { cy.visit('/testnet4/block/000000000066e8b6cc78a93f8989587f5819624bae2eb1c05f535cadded19f99'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('h2').invoke('text').should('equal', '18 transactions'); cy.get('ul.pagination').first().children().should('have.length', 5); @@ -121,6 +124,7 @@ describe('Testnet4', () => { it('supports pagination on the block screen', () => { // 48 txs cy.visit('/testnet4/block/000000000000006982d53f8273bdff21dafc380c292eabc669b5ab6d732311c3'); + cy.get('.pagination').scrollIntoView({ offset: { top: 200, left: 0 } }); cy.waitForSkeletonGone(); cy.get('.header-bg.box > a').invoke('text').then((text1) => { cy.get('.active + li').first().click().then(() => { diff --git a/frontend/src/app/components/block/block-transactions.component.ts b/frontend/src/app/components/block/block-transactions.component.ts index 862338bc1..29e825ac1 100644 --- a/frontend/src/app/components/block/block-transactions.component.ts +++ b/frontend/src/app/components/block/block-transactions.component.ts @@ -58,9 +58,11 @@ export class BlockTransactionsComponent implements OnInit, OnDestroy { this.blockReward.emit(blockReward); } this.unsubscribeNextBlockSubscriptions(); - setTimeout(() => { - this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(this.previousBlockHash).subscribe(); - }, 100); + if (this.previousBlockHash) { + setTimeout(() => { + this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(this.previousBlockHash).subscribe(); + }, 100); + } }) );