Skip to content

Commit

Permalink
Add transfer between account test
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Oct 25, 2023
1 parent 7f89c95 commit 0c138e6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 0 additions & 1 deletion web-frontend/cypress/downloads/downloads.html

This file was deleted.

27 changes: 27 additions & 0 deletions web-frontend/cypress/e2e/acceptance/home/send.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,33 @@ describe('E2E | Acceptance | Home', () => {
performPercentAction(1, account, standardFees);
});

it('should transfer to accounts', () => {
const randomIndex = Math.floor(Math.random() * mockedAccounts.length);
const selectedAccount = mockedAccounts.at(randomIndex);

console.log(mockedAccounts);

navigateToTransfercoins(2);

cy.get('[data-testid="transfer-between-accounts"]')
.should('exist')
.click();

cy.get('[data-testid="popup-modal-content"').should('exist');

cy.get('[data-testid="selector-account-list"]').should('exist');

for (let i = 0; i < mockedAccounts.length; i++) {
cy.get(`[data-testid="selector-account-${i}"]`).should('exist');
}

cy.get(`[data-testid="selector-account-${randomIndex}"]`).click();
cy.get(`[data-testid="input-field"]`).should(
'have.value',
selectedAccount.address,
);
});

// it('should land on receive page when receive CTA is clicked', () => {
// const account = mockedAccounts.at(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ function AccountSelect(props: ContactListProps) {
<label className="mas-title mb-6">My accounts</label>
</PopupModalHeader>
<PopupModalContent>
<div className="overflow-scroll h-80">
<div
data-testid="selector-account-list"
className="overflow-scroll h-80"
>
{accounts.map((filteredAccount: AccountObject, index: number) => (
<Selector
customClass="pb-4"
key={index}
data-testid={`selector-account-${index}`}
preIcon={<Identicon username={filteredAccount.nickname} />}
posIcon={<MassaLogo size={24} />}
content={filteredAccount.nickname}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export function SendForm({ ...props }) {
<div className="flex flex-row-reverse pb-3.5">
<p className="hover:cursor-pointer">
<u
data-testid="transfer-between-accounts"
className="mas-body2"
onClick={() => setContactListModal(true)}
>
Expand Down

0 comments on commit 0c138e6

Please sign in to comment.