Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web messages #2333

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions apps/desktop/src/views/home/AccountsList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("<AccountsList />", () => {
await act(() => user.click(removeSocial));

expect(screen.getByTestId("description")).toHaveTextContent(
"Are you sure you want to remove all of your Social Accounts?"
"Are you sure you want to remove all of your Social accounts?"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why S is capital in social ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented on copy doc for this

);
});

Expand Down Expand Up @@ -140,7 +140,7 @@ describe("<AccountsList />", () => {

const socialAccounts = screen.getByTestId(/account-group-social/i);
expect(within(socialAccounts).getAllByTestId("account-tile-container")).toHaveLength(2);
expect(socialAccounts).toHaveTextContent("Social Accounts");
expect(socialAccounts).toHaveTextContent("Social accounts");
expect(socialAccounts).toHaveTextContent(GOOGLE_ACCOUNT_LABEL2);
expect(socialAccounts).toHaveTextContent(GOOGLE_ACCOUNT_LABEL2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("<UpsertNetworkModal />", () => {
await act(() => user.clear(screen.getByLabelText("RPC URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt API URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt Explorer URL")));
await act(() => user.clear(screen.getByLabelText("Buy Tez URL")));
await act(() => user.clear(screen.getByLabelText("Buy tez URL")));
await act(() => user.type(screen.getByLabelText("RPC URL"), updatedNetwork.rpcUrl));
await act(() => user.type(screen.getByLabelText("Tzkt API URL"), updatedNetwork.tzktApiUrl));
await act(() =>
Expand All @@ -58,7 +58,7 @@ describe("<UpsertNetworkModal />", () => {
await act(() => user.clear(screen.getByLabelText("RPC URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt API URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt Explorer URL")));
await act(() => user.clear(screen.getByLabelText("Buy Tez URL")));
await act(() => user.clear(screen.getByLabelText("Buy tez URL")));
await act(() => user.type(screen.getByLabelText("RPC URL"), updatedNetwork.rpcUrl + "///"));
await act(() =>
user.type(screen.getByLabelText("Tzkt API URL"), updatedNetwork.tzktApiUrl + "///")
Expand All @@ -82,7 +82,7 @@ describe("<UpsertNetworkModal />", () => {
{ label: "RPC URL", required: true },
{ label: "Tzkt API URL", required: true },
{ label: "Tzkt Explorer URL", required: true },
{ label: "Buy Tez URL", required: false },
{ label: "Buy tez URL", required: false },
];

it.each(urlFields)("validates $label field", async ({ label, required }) => {
Expand Down Expand Up @@ -171,14 +171,14 @@ describe("<UpsertNetworkModal />", () => {
await act(() => user.clear(screen.getByLabelText("RPC URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt API URL")));
await act(() => user.clear(screen.getByLabelText("Tzkt Explorer URL")));
await act(() => user.clear(screen.getByLabelText("Buy Tez URL")));
await act(() => user.clear(screen.getByLabelText("Buy tez URL")));
await act(() => user.type(screen.getByLabelText("Name"), customNetwork.name));
await act(() => user.type(screen.getByLabelText("RPC URL"), customNetwork.rpcUrl));
await act(() => user.type(screen.getByLabelText("Tzkt API URL"), customNetwork.tzktApiUrl));
await act(() =>
user.type(screen.getByLabelText("Tzkt Explorer URL"), customNetwork.tzktExplorerUrl!)
);
await act(() => user.type(screen.getByLabelText("Buy Tez URL"), customNetwork.buyTezUrl!));
await act(() => user.type(screen.getByLabelText("Buy tez URL"), customNetwork.buyTezUrl!));

await waitFor(() => {
expect(screen.getByText("Add network")).toBeEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const UpsertNetworkModal = ({ network }: { network?: Network }) => {
</FormControl>

<FormControl isInvalid={!!errors.buyTezUrl}>
<FormLabel>Buy Tez URL</FormLabel>
<FormLabel>Buy tez URL</FormLabel>
<Input placeholder="https://faucet.ghostnet.teztnets.com" {...register("buyTezUrl")} />
{errors.buyTezUrl && <FormErrorMessage>{errors.buyTezUrl.message}</FormErrorMessage>}
</FormControl>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/AccountCard/AccountBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AccountBalance = () => {
fontWeight="600"
size="sm"
>
Tez Balance
Tez balance
</Text>
<Text color={color("900")} fontWeight="600" data-testid="tez-balance" size="2xl">
{balance ? prettyTezAmount(balance) : `0 ${TEZ}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("<AccountInfoModal />", () => {
it("renders correctly with initial values", async () => {
await renderInModal(<AccountInfoModal account={mockAccount} />);

await waitFor(() => expect(screen.getByText("Account Info")).toBeVisible());
await waitFor(() => expect(screen.getByText("Account info")).toBeVisible());
expect(
screen.getByText(
"You can receive tez or other digital assets by scanning or sharing this QR code"
Expand All @@ -24,7 +24,7 @@ describe("<AccountInfoModal />", () => {

await renderInModal(<AccountInfoModal account={mockAccount} />);

await act(() => user.click(screen.getByRole("button", { name: "Copy Wallet Address" })));
await act(() => user.click(screen.getByRole("button", { name: "Copy wallet address" })));

await waitFor(() => expect(screen.getByText("Copied!")).toBeVisible());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AccountInfoModal = ({ account }: AccountInfoModalProps) => {
<ModalContent>
<ModalHeader>
<VStack gap="12px">
<Heading size="xl">Account Info</Heading>
<Heading size="xl">Account info</Heading>
<Text maxWidth="340px" color={color("700")} fontWeight="400" size="md">
You can receive tez or other digital assets by scanning or sharing this QR code
</Text>
Expand Down Expand Up @@ -68,7 +68,7 @@ export const AccountInfoModal = ({ account }: AccountInfoModalProps) => {
variant="primary"
>
<Icon as={CopyIcon} />
<Text>Copy Wallet Address</Text>
<Text>Copy wallet address</Text>
</CopyButton>
</ModalFooter>
</ModalContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe("<AccountSelectorModal />", () => {
await waitFor(() =>
expect(screen.getByText(`Seedphrase ${mockMnemonicAccount(0).seedFingerPrint}`)).toBeVisible()
);
expect(screen.getByText("Social Accounts")).toBeVisible();
expect(screen.getByText("Ledger Accounts")).toBeVisible();
expect(screen.getByText("Social accounts")).toBeVisible();
expect(screen.getByText("Ledger accounts")).toBeVisible();
});

it.each([
Expand Down Expand Up @@ -79,12 +79,12 @@ describe("<AccountSelectorModal />", () => {
const removeButton = screen.getByLabelText(`Remove ${accountLabel} accounts`);
await act(() => user.click(removeButton));

expect(screen.getByText("Remove All Accounts")).toBeInTheDocument();
expect(screen.getByText("Remove all accounts")).toBeInTheDocument();

const expectedMessage =
type === "mnemonic"
? `Are you sure you want to remove all accounts derived from the ${accountLabel}? You will need to manually import them again.`
: `Are you sure you want to remove all of your ${accountLabel} accounts? You will need to manually import them again.`;
: `Are you sure you want to remove all of your ${accountLabel}? You will need to manually import them again.`;

await waitFor(() => expect(screen.getByText(expectedMessage)).toBeVisible());
}
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("<AccountSelectorModal />", () => {
const removeButton = screen.getByLabelText(`Remove ${accountLabel} accounts`);
await act(() => user.click(removeButton));

expect(screen.getByText("Remove & Off-board")).toBeInTheDocument();
expect(screen.getByText("Remove & off-board")).toBeInTheDocument();

await waitFor(() =>
expect(
Expand All @@ -151,7 +151,7 @@ describe("<AccountSelectorModal />", () => {
const { openWith } = dynamicModalContextMock;
await renderInModal(<AccountSelectorModal />, store);

await act(() => user.click(screen.getByText("Add Account")));
await act(() => user.click(screen.getByText("Add account")));

expect(openWith).toHaveBeenCalledWith(<OnboardOptionsModal />);
});
Expand Down Expand Up @@ -182,7 +182,7 @@ describe("<AccountSelectorModal />", () => {
it("does not render 'Add Account' button", async () => {
await renderInModal(<AccountSelectorModal />, store);

expect(screen.queryByText("Add Account")).not.toBeInTheDocument();
expect(screen.queryByText("Add account")).not.toBeInTheDocument();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const AccountSelectorModal = () => {
}
};

const buttonLabel = (isLast: boolean) => (isLast ? "Remove & Off-board" : "Remove");
const buttonLabel = (isLast: boolean) => (isLast ? "Remove & off-board" : "Remove");
const description = (isLast: boolean, type: string) => {
const isMnemonic = type.toLowerCase().includes("seedphrase");

Expand All @@ -98,7 +98,7 @@ export const AccountSelectorModal = () => {
} else if (isMnemonic) {
return `Are you sure you want to remove all accounts derived from the ${type}? You will need to manually import them again.`;
} else {
return `Are you sure you want to remove all of your ${type} accounts? You will need to manually import them again.`;
return `Are you sure you want to remove all of your ${type}? You will need to manually import them again.`;
}
};

Expand All @@ -118,7 +118,7 @@ export const AccountSelectorModal = () => {
}
goBack();
}}
title="Remove All Accounts"
title="Remove all accounts"
/>
);
};
Expand Down Expand Up @@ -223,7 +223,7 @@ export const AccountSelectorModal = () => {
onClick={() => openWith(<OnboardOptionsModal />)}
variant="primary"
>
Add Account
Add account
</Button>
</Flex>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("AccountSelectorPopover", () => {

await act(() => user.click(screen.getByLabelText("Account actions")));

await waitFor(() => expect(screen.getByText("Account Info")).toBeVisible());
await waitFor(() => expect(screen.getByText("Account info")).toBeVisible());
expect(screen.getByText("Rename")).toBeVisible();
expect(screen.getByText("Remove")).toBeVisible();
expect(screen.getByText("View in TzKT")).toBeVisible();
Expand All @@ -63,7 +63,7 @@ describe("AccountSelectorPopover", () => {

await act(async () => {
await user.click(screen.getByLabelText("Account actions"));
await user.click(screen.getByText("Account Info"));
await user.click(screen.getByText("Account info"));
});

expect(openWith).toHaveBeenCalledWith(<AccountInfoModal account={mockAccount} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const AccountSelectorPopover = ({ account }: AccountSelectorPopoverProps)
>
<SearchIcon />
<Text color={color("900")} fontWeight="600">
Account Info
Account info
</Text>
</Button>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("<DeriveMnemonicAccountModal />", () => {
await renderInModal(<DeriveMnemonicAccountModal account={account} />, store);

await waitFor(() => {
expect(screen.getByText("Name Your Account")).toBeVisible();
expect(screen.getByText("Name your account")).toBeVisible();
});

expect(
Expand All @@ -46,7 +46,7 @@ describe("<DeriveMnemonicAccountModal />", () => {

const account = mockMnemonicAccount(0);
await renderInModal(<DeriveMnemonicAccountModal account={account} />, store);
await act(() => user.type(screen.getByLabelText("Account name (Optional)"), "Test Account"));
await act(() => user.type(screen.getByLabelText("Account name (optional)"), "Test Account"));
await act(() => user.click(screen.getByRole("button", { name: "Continue" })));

await waitFor(() => {
Expand All @@ -64,7 +64,7 @@ describe("<DeriveMnemonicAccountModal />", () => {
const account = mockMnemonicAccount(0);
await renderInModal(<DeriveMnemonicAccountModal account={account} />, store);

await act(() => user.type(screen.getByLabelText("Account name (Optional)"), newAccount.label));
await act(() => user.type(screen.getByLabelText("Account name (optional)"), newAccount.label));
await act(() => user.click(screen.getByRole("button", { name: "Continue" })));
await act(() => user.type(screen.getByLabelText("Password"), "test-password"));
await waitFor(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("<RemoveAccountModal />", () => {
addTestAccounts(store, accounts);
await renderInModal(<RemoveAccountModal account={accounts[0]} />, store);

await waitFor(() => expect(screen.getByText("Remove Account")).toBeVisible());
await waitFor(() => expect(screen.getByText("Remove account")).toBeVisible());
expect(
screen.getByText(
"Are you sure you want to hide this account? You will need to manually import it again."
Expand All @@ -55,13 +55,13 @@ describe("<RemoveAccountModal />", () => {

await renderInModal(<RemoveAccountModal account={accounts[0]} />, store);

await waitFor(() => expect(screen.getByText("Remove Account")).toBeVisible());
await waitFor(() => expect(screen.getByText("Remove account")).toBeVisible());
expect(
screen.getByText(
"Removing your last account will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected."
)
).toBeVisible();
expect(screen.getByText("Remove & Off-board")).toBeVisible();
expect(screen.getByText("Remove & off-board")).toBeVisible();
});

it("handles account removal and navigates correctly when only one account", async () => {
Expand All @@ -71,7 +71,7 @@ describe("<RemoveAccountModal />", () => {

await renderInModal(<RemoveAccountModal account={accounts[0]} />, store);

await act(() => user.click(screen.getByText("Remove & Off-board")));
await act(() => user.click(screen.getByText("Remove & off-board")));

expect(mockRemoveAccount).toHaveBeenCalledWith(accounts[0]);
expect(onClose).toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export const RemoveAccountModal = ({ account }: RemoveAccountModalProps) => {
"Removing your last account will off-board you from Umami. " +
"This will remove or reset all customized settings to their defaults. " +
"Personal data (including saved contacts, password and accounts) won't be affected.";
buttonLabel = "Remove & Off-board";
buttonLabel = "Remove & off-board";
}

return (
<ConfirmationModal
buttonLabel={buttonLabel}
description={description}
onSubmit={handleRemoveAccount}
title="Remove Account"
title="Remove account"
/>
);
};
4 changes: 2 additions & 2 deletions apps/web/src/components/AddContactModal/AddContactModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const AddContactModal: FC<{
<ModalContent>
<form onSubmit={handleSubmit(onSubmit)}>
<ModalHeader>
<Heading size="xl">Add Contact</Heading>
<Heading size="xl">Add contact</Heading>
<ModalCloseButton />
</ModalHeader>
<ModalBody gap="24px">
Expand Down Expand Up @@ -123,7 +123,7 @@ export const AddContactModal: FC<{
type="submit"
variant="primary"
>
Add to Address Book
Add to address book
</Button>
</ModalFooter>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe("<AdvancedSettingsAccordion />", () => {
render(<TestComponent />);
await act(() => user.click(screen.getByRole("button", { name: "Advanced" })));

const gasLimitInput = screen.getByLabelText("Gas Limit");
const gasLimitInput = screen.getByLabelText("Gas limit");

await act(() => user.type(gasLimitInput, "1000"));

Expand All @@ -74,7 +74,7 @@ describe("<AdvancedSettingsAccordion />", () => {
render(<TestComponent />);
await act(() => user.click(screen.getByRole("button", { name: "Advanced" })));

const storageLimitInput = screen.getByLabelText("Storage Limit");
const storageLimitInput = screen.getByLabelText("Storage limit");

await act(() => user.type(storageLimitInput, "1000"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const AdvancedSettingsAccordion = ({ index = 0 }: AdvancedSettingsAccordi
</InputGroup>
</FormControl>
<FormControl isInvalid={!!errors.executeParams?.[index]?.gasLimit}>
<FormLabel fontSize="14px">Gas Limit</FormLabel>
<FormLabel fontSize="14px">Gas limit</FormLabel>
<Input
{...register(`executeParams.${index}.gasLimit`, {
valueAsNumber: true,
Expand All @@ -94,7 +94,7 @@ export const AdvancedSettingsAccordion = ({ index = 0 }: AdvancedSettingsAccordi
/>
</FormControl>
<FormControl isInvalid={!!errors.executeParams?.[index]?.storageLimit}>
<FormLabel fontSize="14px">Storage Limit</FormLabel>
<FormLabel fontSize="14px">Storage limit</FormLabel>
<Input
{...register(`executeParams.${index}.storageLimit`, {
valueAsNumber: true,
Expand Down
Loading
Loading