From 1bba1cfeb138bb4ca899edc32621c7b9e9d93576 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 2 Apr 2024 11:35:03 +0800
Subject: [PATCH 1/4] [accelerator] deposit -> top up
---
frontend/src/app/docs/api-docs/api-docs-data.ts | 10 +++++-----
.../mempool-error/mempool-error.component.ts | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/frontend/src/app/docs/api-docs/api-docs-data.ts b/frontend/src/app/docs/api-docs/api-docs-data.ts
index e75254213..a05ecac17 100644
--- a/frontend/src/app/docs/api-docs/api-docs-data.ts
+++ b/frontend/src/app/docs/api-docs/api-docs-data.ts
@@ -10036,18 +10036,18 @@ export const restApiDocsData = [
type: "endpoint",
category: "accelerator-private",
httpRequestMethod: "GET",
- fragment: "accelerator-deposit-history",
- title: "GET Deposit History",
+ fragment: "accelerator-top-up-history",
+ title: "GET Top Up History",
description: {
- default: "
Returns a list of deposits the user has made as prepayment for the accelerator service.
"
+ default: "Returns a list of top ups the user has made as prepayment for the accelerator service.
"
},
- urlString: "/v1/services/accelerator/deposit-history",
+ urlString: "/v1/services/accelerator/top-up-history",
showConditions: [""],
showJsExamples: showJsExamplesDefaultFalse,
codeExample: {
default: {
codeTemplate: {
- curl: `/api/v1/services/accelerator/deposit-history`,
+ curl: `/api/v1/services/accelerator/top-up-history`,
commonJS: ``,
esModule: ``
},
diff --git a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
index 88e24bed2..ac5ac72a1 100644
--- a/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
+++ b/frontend/src/app/shared/components/mempool-error/mempool-error.component.ts
@@ -14,7 +14,7 @@ const MempoolErrors = {
'mempool_rejected_raw_tx': `Our mempool rejected this transaction`,
'no_mining_pool_available': `No mining pool available at the moment`,
'not_available': `You current subscription does not allow you to access this feature.`,
- 'not_enough_balance': `Your account balance is too low. Please make a deposit.`,
+ 'not_enough_balance': `Your balance is too low. Please top up your account.`,
'not_verified': `You must verify your account to use this feature.`,
'recommended_fees_not_available': `Recommended fees are not available right now.`,
'too_many_relatives': `This transaction has too many relatives.`,
From 4bb1320563ef19b5b901c7d68d44d752732c200f Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Tue, 2 Apr 2024 15:14:02 +0900
Subject: [PATCH 2/4] Re-enable and fix Liquid tests
---
frontend/cypress/e2e/liquid/liquid.spec.ts | 17 +++++++++++++----
.../e2e/liquidtestnet/liquidtestnet.spec.ts | 2 +-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/frontend/cypress/e2e/liquid/liquid.spec.ts b/frontend/cypress/e2e/liquid/liquid.spec.ts
index 2d1fbd1e9..8548059bb 100644
--- a/frontend/cypress/e2e/liquid/liquid.spec.ts
+++ b/frontend/cypress/e2e/liquid/liquid.spec.ts
@@ -1,4 +1,4 @@
-describe.skip('Liquid', () => {
+describe('Liquid', () => {
const baseModule = Cypress.env('BASE_MODULE');
const basePath = '';
@@ -23,6 +23,13 @@ describe.skip('Liquid', () => {
cy.get('#mempool-block-0 > .blockLink').should('exist');
});
+ it('load first mempool block after skeleton loads', () => {
+ cy.visit(`${basePath}`);
+ cy.waitForSkeletonGone();
+ cy.get('#mempool-block-0 > .blockLink').click();
+ cy.waitForSkeletonGone();
+ });
+
it('loads the dashboard', () => {
cy.visit(`${basePath}`);
cy.waitForSkeletonGone();
@@ -84,10 +91,11 @@ describe.skip('Liquid', () => {
cy.waitForSkeletonGone();
//TODO: Change to an element id so we don't assert on a string
cy.get('.table-tx-vin').should('contain', 'Peg-in');
- cy.get('.table-tx-vin a').click().then(() => {
+ //Remove the target=_blank attribute so the new url opens in the same tab
+ cy.get('.table-tx-vin a').invoke('removeAttr', 'target').click().then(() => {
cy.waitForSkeletonGone();
if (baseModule === 'liquid') {
- cy.url().should('eq', 'https://mempool.space/tx/f148c0d854db4174ea420655235f910543f0ec3680566dcfdf84fb0a1697b592');
+ cy.url().should('eq', 'https://mempool.space/tx/f148c0d854db4174ea420655235f910543f0ec3680566dcfdf84fb0a1697b592#vout=0');
} else {
//TODO: Use an environment variable to get the hostname
cy.url().should('eq', 'http://localhost:4200/tx/f148c0d854db4174ea420655235f910543f0ec3680566dcfdf84fb0a1697b592');
@@ -98,7 +106,8 @@ describe.skip('Liquid', () => {
it('loads peg out addresses', () => {
cy.visit(`${basePath}/tx/ecf6eba04ffb3946faa172343c87162df76f1a57b07b0d6dc6ad956b13376dc8`);
cy.waitForSkeletonGone();
- cy.get('.table-tx-vout a').first().click().then(() => {
+ //Remove the target=_blank attribute so the new url opens in the same tab
+ cy.get('.table-tx-vout a').first().invoke('removeAttr', 'target').click().then(() => {
cy.waitForSkeletonGone();
if (baseModule === 'liquid') {
cy.url().should('eq', 'https://mempool.space/address/1BxoGcMg14oaH3CwHD2hF4gU9VcfgX5yoR');
diff --git a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
index be27fa183..1f959dd3a 100644
--- a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+++ b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
@@ -1,4 +1,4 @@
-describe.skip('Liquid Testnet', () => {
+describe('Liquid Testnet', () => {
const baseModule = Cypress.env('BASE_MODULE');
const basePath = '/testnet';
From 468f17c76c3fc99f99cf1570ef0a033d37eecff1 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Tue, 2 Apr 2024 16:18:52 +0900
Subject: [PATCH 3/4] Add a few more Liquid testnet tests
---
.../e2e/liquidtestnet/liquidtestnet.spec.ts | 28 ++++++++++++-------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
index 1f959dd3a..208b3c938 100644
--- a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+++ b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
@@ -28,6 +28,17 @@ describe('Liquid Testnet', () => {
cy.waitForSkeletonGone();
});
+ it('loads the dashboard with no scrollbars on mobile', () => {
+ cy.viewport('iphone-xr');
+ cy.visit(`${basePath}`);
+ cy.waitForSkeletonGone();
+ cy.window().then(window => {
+ const htmlWidth = Cypress.$('html')[0].scrollWidth;
+ const scrollBarWidth = window.innerWidth - htmlWidth;
+ expect(scrollBarWidth).to.be.eq(0); //check for no horizontal scrollbar
+ });
+ });
+
it('loads the blocks page', () => {
cy.visit(`${basePath}`)
cy.get('#btn-blocks');
@@ -57,17 +68,14 @@ describe('Liquid Testnet', () => {
cy.get('.tv-only').should('not.exist');
});
- it.skip('renders unconfidential addresses correctly on mobile', () => {
- cy.viewport('iphone-6');
- cy.visit(`${basePath}/address/__TODO__`);
+ it('renders unconfidential transactions correctly on mobile', () => {
+ cy.viewport('iphone-xr');
+ cy.visit(`${basePath}/tx/b119f338878416781dc285b94c0de52826341dea43566e4de4740d3ebfd1f6dc#blinded=99707,144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49,1377e4ec8eb0c89296e14ffca57e377f4b51ad8f1c881e43364434d8430dbfda,cdd6caae4c3452586cfcb107478dd2b7acaa5f82714a6a966578255e857eee60`);
cy.waitForSkeletonGone();
- //TODO: Add proper IDs for these selectors
- const firstRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(1) > .table > tbody';
- const thirdRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(3)';
- cy.get(firstRowSelector).invoke('css', 'width').then(firstRowWidth => {
- cy.get(thirdRowSelector).invoke('css', 'width').then(thirdRowWidth => {
- expect(parseInt(firstRowWidth)).to.be.lessThan(parseInt(thirdRowWidth));
- });
+ cy.window().then(window => {
+ const htmlWidth = Cypress.$('html')[0].scrollWidth;
+ const scrollBarWidth = window.innerWidth - htmlWidth;
+ expect(scrollBarWidth).to.be.eq(0); //check for no horizontal scrollbar
});
});
From 3e3bed9aa4c093308e103edde5eaa02f4a503918 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Tue, 2 Apr 2024 16:54:02 +0900
Subject: [PATCH 4/4] Disable viewport tests for now
---
frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
index 208b3c938..a96b0700c 100644
--- a/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+++ b/frontend/cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
@@ -28,7 +28,7 @@ describe('Liquid Testnet', () => {
cy.waitForSkeletonGone();
});
- it('loads the dashboard with no scrollbars on mobile', () => {
+ it.skip('loads the dashboard with no scrollbars on mobile', () => {
cy.viewport('iphone-xr');
cy.visit(`${basePath}`);
cy.waitForSkeletonGone();
@@ -68,7 +68,7 @@ describe('Liquid Testnet', () => {
cy.get('.tv-only').should('not.exist');
});
- it('renders unconfidential transactions correctly on mobile', () => {
+ it.skip('renders unconfidential transactions correctly on mobile', () => {
cy.viewport('iphone-xr');
cy.visit(`${basePath}/tx/b119f338878416781dc285b94c0de52826341dea43566e4de4740d3ebfd1f6dc#blinded=99707,144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49,1377e4ec8eb0c89296e14ffca57e377f4b51ad8f1c881e43364434d8430dbfda,cdd6caae4c3452586cfcb107478dd2b7acaa5f82714a6a966578255e857eee60`);
cy.waitForSkeletonGone();