Skip to content

Commit

Permalink
chore: addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Mar 7, 2024
1 parent 0cff640 commit f1c1068
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
18 changes: 3 additions & 15 deletions commands/keplr.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,22 +360,10 @@ const keplr = {
const innerTexts = await parentElement.allInnerTexts();
const textArray = innerTexts[0].split('\n');

let numberString;
for (const element of textArray) {
const elementWithNoCommas = element.replace(/,/g, '');
if (!isNaN(parseFloat(elementWithNoCommas))) {
numberString = elementWithNoCommas;
break;
}
}

if (!numberString) {
throw new Error(`Token value for ${tokenName} not found`);
}

let tokenValue = parseFloat(numberString);
const tokenValue = textArray[3];
const parsedTokenValue = Number(tokenValue.replace(/,/g, ''));
await playwright.switchToCypressWindow();
return tokenValue;
return parsedTokenValue;
},
};

Expand Down
7 changes: 2 additions & 5 deletions tests/e2e/specs/keplr/keplr-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ describe('Keplr', () => {
});
cy.addNewTokensFound();
cy.getTokenAmount('ATOM').then(tokenValue => {
expect(Number.isFinite(tokenValue)).to.be.true;
expect(tokenValue).to.equal(0);
});
cy.getTokenAmount('BLD').then(tokenValue => {
expect(Number.isFinite(tokenValue)).to.be.true;
});
cy.getTokenAmount('IST').then(tokenValue => {
expect(Number.isFinite(tokenValue)).to.be.true;
expect(tokenValue).to.equal(331);
});
});
it(`should disconnect the wallet from all the connected DAPPs`, () => {
Expand Down

0 comments on commit f1c1068

Please sign in to comment.