Skip to content

Commit

Permalink
added testcse
Browse files Browse the repository at this point in the history
  • Loading branch information
fullstackninja864 committed Aug 3, 2023
1 parent e9dae2a commit 34005db
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mobile-app/app/components/DomainSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {
"text-white": isLight,
"text-black": !isLight,
})}
testID={`${testID}_DFI`}
>
DFI
</Text>
Expand Down Expand Up @@ -80,6 +81,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {
style={tailwind(
"text-mono-light-v2-00 text-xs ml-1 font-normal-v2"
)}
testID={`${testID}_EVM`}
>
EVM
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {
style={tailwind("text-xs font-normal-v2 pr-1")}
dark={tailwind("text-mono-dark-v2-700")}
light={tailwind("text-mono-light-v2-700")}
testID="bottomsheet-address-header"
>
{domain}
</ThemedTextV2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ context("Wallet - Addresses", () => {
cy.getByTestID("active_address")
.invoke("css", "text-overflow")
.should("eq", "ellipsis");
cy.getByTestID("bottomsheet-address-header").contains("DFI");
cy.getByTestID("active_address").click();
cy.getByTestID("wallet_toast").should("exist");
});
Expand All @@ -71,6 +72,24 @@ context("Wallet - Addresses", () => {
});
});

it("should show EVM address when toggle set to EVM", () => {
cy.getByTestID("header_settings").click();
cy.getByTestID("address_book_title").click();
cy.getByTestID("address_button_group_YOUR_ADDRESS").click();
cy.getByTestID("address_row_text_0_YOUR_ADDRESS_EVM")
.invoke("text")
.then((evmAddress: string) => {
cy.getByTestID("bottom_tab_portfolio").click();
cy.getByTestID("domain_switch_DFI").should("exist");
cy.getByTestID("domain_switch").click();
cy.getByTestID("domain_switch_EVM").should("exist");
cy.getByTestID("switch_account_button").click();
cy.getByTestID("address_row_text_0").contains(evmAddress);
cy.getByTestID("bottomsheet-address-header").contains("EVM");
cy.getByTestID("close_bottom_sheet_button").click();
});
});

it("should be able to create new address when all available address are active", () => {
cy.sendDFItoWallet().wait(4000);
cy.getByTestID("dfi_total_balance_amount")
Expand Down

0 comments on commit 34005db

Please sign in to comment.