Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions extension/e2e-tests/loadAccount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,3 +657,21 @@ test("Loads wallets data and token prices on Mainnet in batches", async ({

expect(tokenPricesCallCount).toBe(7);
});

test("Renames wallets", async ({ page, extensionId, context }) => {
await stubTokenDetails(page);
await stubAccountHistory(page);
await stubTokenPrices(page);
await stubScanDapp(context);

await loginToTestAccount({ page, extensionId });
await page.getByTestId("account-view-account-name").click();
await expect(page.getByText("Wallets")).toBeVisible();

const walletRowOptions = await page.getByTestId("wallet-row-options").all();
await walletRowOptions[0].click();
await page.getByText("Rename wallet").click();
await page.getByTestId("rename-wallet-input").fill("New Wallet");
await page.getByText("Save").click();
await expect(page.getByText("New Wallet")).toBeVisible();
});
4 changes: 2 additions & 2 deletions extension/e2e-tests/sendPayment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ test("Send XLM payment to C address", async ({ page, extensionId }) => {
timeout: 60000,
});

await page.getByTestId(`SubmitAction`).click({ force: true });
await page.getByTestId(`SubmitAction`).click({ force: true, timeout: 60000 });

let accountBalancesRequestWasMade = false;
page.on("request", (request) => {
Expand Down Expand Up @@ -616,7 +616,7 @@ test("Send token payment to C address", async ({ page, extensionId }) => {
timeout: 60000,
});

await page.getByTestId(`SubmitAction`).click({ force: true });
await page.getByTestId(`SubmitAction`).click({ force: true, timeout: 60000 });

let accountBalancesRequestWasMade = false;
page.on("request", (request) => {
Expand Down
13 changes: 7 additions & 6 deletions extension/src/popup/views/Wallets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { IdenticonImg } from "popup/components/identicons/IdenticonImg";
import {
makeAccountActive,
updateAccountName,
allAccountsSelector,
} from "popup/ducks/accountServices";
import { settingsNetworkDetailsSelector } from "popup/ducks/settings";
import { clearBalancesForAccount } from "popup/ducks/cache";
Expand All @@ -39,9 +40,9 @@ import { AppDataType } from "helpers/hooks/useGetAppData";
import { newTabHref } from "helpers/urls";
import { navigateTo, openTab } from "popup/helpers/navigate";
import { reRouteOnboarding } from "popup/helpers/route";
import { WalletType } from "@shared/constants/hardwareWallet";

import "./styles.scss";
import { WalletType } from "@shared/constants/hardwareWallet";

interface AddWalletProps {
onBack: () => void;
Expand Down Expand Up @@ -163,6 +164,7 @@ const RenameWallet = ({
<Field name="accountName">
{({ field }: FieldProps) => (
<Input
data-testid="rename-wallet-input"
autoFocus
fieldSize="md"
autoComplete="off"
Expand Down Expand Up @@ -273,6 +275,7 @@ const WalletRow = ({
</div>
<div
className="WalletRow__options"
data-testid="wallet-row-options"
onClick={() => setOptionsOpen(publicKey)}
>
<img src={IconEllipsis} alt="wallet action options" />
Expand All @@ -292,6 +295,7 @@ export const Wallets = () => {
React.useState("");
const { state: dataState, fetchData } = useGetWalletsData();
const networkDetails = useSelector(settingsNetworkDetailsSelector);
const allAccounts = useSelector(allAccountsSelector);

useEffect(() => {
const getData = async () => {
Expand Down Expand Up @@ -363,11 +367,7 @@ export const Wallets = () => {
);
}

const {
allAccounts,
publicKey: activePublicKey,
accountValue,
} = dataState.data;
const { publicKey: activePublicKey, accountValue } = dataState.data;

return (
<React.Fragment>
Expand Down Expand Up @@ -402,6 +402,7 @@ export const Wallets = () => {
return (
<>
<WalletRow
key={publicKey}
isFetchingTokenPrices={isFetchingTokenPrices}
accountName={name}
accountValue={totalValueUsd}
Expand Down