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

fix: input placeholder got cut (send) #1517 #1591

Merged
merged 1 commit into from
Oct 17, 2022
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
20 changes: 6 additions & 14 deletions src/app/screens/Send/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,25 @@ describe("Send", () => {
</MemoryRouter>
);

expect(
await screen.getByLabelText("Invoice, Lightning Address or LNURL")
).toBeInTheDocument();
expect(await screen.getByLabelText("Recipient")).toBeInTheDocument();

await act(async () => {
await user.type(
screen.getByLabelText("Invoice, Lightning Address or LNURL"),
screen.getByLabelText("Recipient"),
" sampleinvoice "
);
});

expect(
screen.getByLabelText("Invoice, Lightning Address or LNURL")
).toHaveValue("sampleinvoice");
expect(screen.getByLabelText("Recipient")).toHaveValue("sampleinvoice");

await act(async () => {
await user.clear(
screen.getByLabelText("Invoice, Lightning Address or LNURL")
);
await user.clear(screen.getByLabelText("Recipient"));
await user.type(
screen.getByLabelText("Invoice, Lightning Address or LNURL"),
screen.getByLabelText("Recipient"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

is Recipient a good word here?
Is an "invoice" a recipient?

"lightning:test@getalby.com"
);
});

expect(
screen.getByLabelText("Invoice, Lightning Address or LNURL")
).toHaveValue("test@getalby.com");
expect(screen.getByLabelText("Recipient")).toHaveValue("test@getalby.com");
});
});
2 changes: 1 addition & 1 deletion src/app/screens/Send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function Send() {
<TextField
id="invoice"
label={t("input.label")}
placeholder={t("input.placeholder")}
hint={t("input.hint")}
value={invoice}
disabled={loading}
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@
"title": "Waiting to scan"
},
"input": {
"label": "Invoice, Lightning Address or LNURL",
"placeholder": "Paste invoice, lnurl or lightning address"
"label": "Recipient",
Copy link
Collaborator

Choose a reason for hiding this comment

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

is Recipient a good word here?
Is an "invoice" a recipient?

"hint": "Invoice, Lightning Address or LNURL"
}
},
"lnurlpay": {
Expand Down