Revert "fix cypress test for address poisoning highlighting"

This commit is contained in:
wiz 2026-03-30 11:42:19 +09:00 committed by GitHub
parent bf61ad0ddf
commit 6db078e267
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -229,15 +229,18 @@ describe('Mainnet', () => {
cy.get('.alert-mempool').should('exist');
cy.get('.poison-alert').its('length').should('equal', 2);
cy.get('.poison-alert').parent().find('.address-content').should('have.length', 2).then(($containers) => {
const prefixes = $containers.map((i, el) => Cypress.$(el).find('.prefix').text()).get();
const infixes = $containers.map((i, el) => Cypress.$(el).find('.infix').text()).get().sort();
cy.get('.prefix')
.should('have.length', 2)
.each(($el) => {
cy.wrap($el).should('have.text', prefix);
});
expect(prefixes).to.have.length(2);
prefixes.forEach((p) => expect(p).to.equal(prefix));
expect(infixes).to.deep.equal([infix1, infix2].sort());
});
cy.get('.infix')
.should('have.length', 2)
.then(($infixes) => {
cy.wrap($infixes[0]).should('have.text', infix1);
cy.wrap($infixes[1]).should('have.text', infix2);
});
});
it('highlights potential address poisoning attacks on inputs and outputs, prefix, infix and postfix', () => {
@ -253,17 +256,26 @@ describe('Mainnet', () => {
cy.get('.alert-mempool').should('exist');
cy.get('.poison-alert').its('length').should('equal', 2);
cy.get('.poison-alert').parent().find('.address-content').should('have.length', 2).then(($containers) => {
const prefixes = $containers.map((i, el) => Cypress.$(el).find('.prefix').text()).get();
const infixes = $containers.map((i, el) => Cypress.$(el).find('.infix').text()).get().sort();
const postfixes = $containers.map((i, el) => Cypress.$(el).find('.postfix').text()).get().sort();
cy.get('.prefix')
.should('have.length', 2)
.each(($el) => {
cy.wrap($el).should('have.text', prefix);
});
expect(prefixes).to.have.length(2);
prefixes.forEach((p) => expect(p).to.equal(prefix));
cy.get('.infix')
.should('have.length', 2)
.then(($infixes) => {
cy.wrap($infixes[0]).should('have.text', infix1);
cy.wrap($infixes[1]).should('have.text', infix2);
});
cy.get('.postfix')
.should('have.length', 2)
.then(($postfixes) => {
cy.wrap($postfixes[0]).should('include.text', postfix1);
cy.wrap($postfixes[1]).should('include.text', postfix2);
});
expect(infixes).to.deep.equal([infix1, infix2].sort());
expect(postfixes).to.deep.equal([postfix1, postfix2].sort());
});
});
});