Add a few more Liquid testnet tests

This commit is contained in:
Felipe Knorr Kuhn 2024-04-02 16:18:52 +09:00
parent 4bb1320563
commit 468f17c76c
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A

View File

@ -28,6 +28,17 @@ describe('Liquid Testnet', () => {
cy.waitForSkeletonGone(); 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', () => { it('loads the blocks page', () => {
cy.visit(`${basePath}`) cy.visit(`${basePath}`)
cy.get('#btn-blocks'); cy.get('#btn-blocks');
@ -57,17 +68,14 @@ describe('Liquid Testnet', () => {
cy.get('.tv-only').should('not.exist'); cy.get('.tv-only').should('not.exist');
}); });
it.skip('renders unconfidential addresses correctly on mobile', () => { it('renders unconfidential transactions correctly on mobile', () => {
cy.viewport('iphone-6'); cy.viewport('iphone-xr');
cy.visit(`${basePath}/address/__TODO__`); cy.visit(`${basePath}/tx/b119f338878416781dc285b94c0de52826341dea43566e4de4740d3ebfd1f6dc#blinded=99707,144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49,1377e4ec8eb0c89296e14ffca57e377f4b51ad8f1c881e43364434d8430dbfda,cdd6caae4c3452586cfcb107478dd2b7acaa5f82714a6a966578255e857eee60`);
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
//TODO: Add proper IDs for these selectors cy.window().then(window => {
const firstRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(1) > .table > tbody'; const htmlWidth = Cypress.$('html')[0].scrollWidth;
const thirdRowSelector = '.container-xl > :nth-child(3) > div > :nth-child(3)'; const scrollBarWidth = window.innerWidth - htmlWidth;
cy.get(firstRowSelector).invoke('css', 'width').then(firstRowWidth => { expect(scrollBarWidth).to.be.eq(0); //check for no horizontal scrollbar
cy.get(thirdRowSelector).invoke('css', 'width').then(thirdRowWidth => {
expect(parseInt(firstRowWidth)).to.be.lessThan(parseInt(thirdRowWidth));
});
}); });
}); });