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

[ops] offramp-zh-fe and CommaNumberInput.tsx changes for variable decimals. ![S #436

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0ee90a7
[ops] offramp-zh-fe and CommaNumberInput.tsx changes for variable dec…
ch-brian Oct 30, 2024
f727a20
[ui] Fix issue where visibleChanged does not cause rerender (#13170)
coreymartin Oct 31, 2024
da44b3d
Create little-hats-accept.md
coreymartin Oct 31, 2024
d72f2ba
[ui] Improved CommaNumberInput (#13187)
coreymartin Nov 4, 2024
c4b1c7f
[ui] Upgrade react-table to v8 (#13219)
coreymartin Nov 4, 2024
3b546bf
CI update lock file for PR
Nov 4, 2024
fa07119
[uma-bridge] Add send page (#12921)
coreymartin Nov 5, 2024
ca1779f
Surfacing fee_estimate query into ops side and creating tooltip in UI…
JasonCWang Nov 5, 2024
87f46ef
[uma-bridge] Add UMA address validation to send page. Upgrade UMA SDK…
coreymartin Nov 5, 2024
6662498
CI update lock file for PR
Nov 5, 2024
8c7054d
create invite bridge page (#13074)
matthappens Nov 5, 2024
17d5a49
[private-ui] Move recaptcha to service (#13321)
coreymartin Nov 8, 2024
deffd4d
[uma-bridge] Default to BR dialing code when partner is Nubank (#13402)
coreymartin Nov 13, 2024
1856df2
[core] Only allow preferred_currency_value_approx to override value f…
coreymartin Nov 14, 2024
b5139b1
[uma-bridge] Improved amount input for Send page (#13149)
coreymartin Nov 15, 2024
ae008d8
[uma-bridge] Add currency indicators (#13358)
coreymartin Nov 15, 2024
57b972d
[uma-bridge] Confirm quote (#13359)
coreymartin Nov 15, 2024
fafff8e
[ui] Support round icon buttons. Enable forced square aspect ratio fo…
coreymartin Nov 19, 2024
d859584
[ui] Fix ghost button theme defaults (#13525)
coreymartin Nov 20, 2024
5882602
[uma-bridge] Fix autofocus (#13502)
coreymartin Nov 20, 2024
561d3f8
[uma-bridge] ConfirmQuoteTransferDetails (#13374)
coreymartin Nov 20, 2024
bad03ab
[ui] Fix default icon side right (#13540)
coreymartin Nov 20, 2024
8c37a4e
[sparkcore] Change clientlogs and analytics endpoints
mgorven Nov 20, 2024
d6aff5e
[uma-bridge] Send ?track param to /ui/event (#13559)
coreymartin Nov 21, 2024
bf36749
DataManagerTable Custom Header (#13412)
carsonp6 Nov 26, 2024
e44b6a2
Make popover fullscreen for small devices (#13553)
carsonp6 Nov 26, 2024
0d965a4
Add filters to transactions page (#13534)
carsonp6 Nov 26, 2024
069bec2
Update min date for date filter (#13676)
carsonp6 Nov 26, 2024
b0544a4
[sparkcore] Send proper GA client id (#13735)
coreymartin Nov 30, 2024
6b0c364
[uma-bridge] Show new authorization if necessary when confirming send…
coreymartin Dec 2, 2024
7962bec
fix feedback from design walkthrough (#13763)
matthappens Dec 3, 2024
814ebda
[bridge] disable send/receive + show card if in manual review (#14053)
shreyav Dec 8, 2024
f17fd07
[core] Properly divide MXN cents by 100 for display (#14075)
coreymartin Dec 8, 2024
864c574
[core, ui, uma-bridge] Allow passing appendUnits arg to formatCurrenc…
coreymartin Dec 9, 2024
93877a8
add invite menu item (#14087)
matthappens Dec 9, 2024
9497cb3
[uma-bridge] Add receive page (#13769)
coreymartin Dec 9, 2024
a237e1e
[uma-bridge] Swap receive icons (#14103)
coreymartin Dec 9, 2024
e01752b
[uma-bridge] Regenerate quote from confirm page every 30 seconds (#14…
coreymartin Dec 9, 2024
edaa333
Fix formatting in re-share invite modal (#14120)
carsonp6 Dec 9, 2024
26e7433
Add new alternate incentive invite cards (#14141)
carsonp6 Dec 10, 2024
a611f8f
Incentive modal (#14156)
carsonp6 Dec 10, 2024
752c26b
[ui] Fix BelowCardForm bottom spacing (#14258)
coreymartin Dec 11, 2024
8e1a0ce
Display empty state for bank on uma card and add navigation to connec…
carsonp6 Dec 11, 2024
b2a2937
[ui] Remove height 100% from sm CardFormContent (#14296)
coreymartin Dec 12, 2024
50c55d4
Add uma loading animation for sending payments (#14277)
carsonp6 Dec 12, 2024
087a2b6
[us2mx][LIG-7118] transaction details frontend. support page to come.…
ch-brian Dec 12, 2024
60942eb
Update receive screen (#14332)
carsonp6 Dec 13, 2024
4814f3e
[uma-bridge] Add send payment taking longer than expected state (#14381)
coreymartin Dec 14, 2024
e0a007c
L1 wallet page (#13827)
carsonp6 Dec 16, 2024
9fc0211
Initialize L1 wallet modal (#13886)
carsonp6 Dec 16, 2024
517b346
Update L1 wallet config screen (#14405)
carsonp6 Dec 16, 2024
7c1d5b1
Ability to pass in right justified title content for PageSectionBoxAc…
carsonp6 Dec 18, 2024
53671cf
Add an invite screen for new issuers in the issuer playground (#14419)
benwgold Dec 18, 2024
7ad1622
continue -> next, and white bg for dropdowns (#14411)
matthappens Dec 18, 2024
505b569
[uma-bridge] Disable BridgeCardForm back button while mutations are r…
coreymartin Dec 18, 2024
34b2926
[stablecoin-issuance] Hides the CN2 UI for users that have the TOKEN_…
ch-brian Dec 19, 2024
07efe04
[site] Add theme toggle (#14497)
coreymartin Dec 20, 2024
ef3291a
[stablecoin-issuance] This change defaults the Base route to the Issu…
ch-brian Dec 20, 2024
e60ad7c
[stablecoin-issuance] file upload drag and drop. base64 validation of…
ch-brian Dec 20, 2024
75202fb
[uma-bridge] enforce lnurlpresponse min/max on sending UI (#14525)
shreyav Dec 21, 2024
3948dbf
[stablecoin-issuance] update the datamanagertable to display the uplo…
ch-brian Jan 3, 2025
b3a511d
[ui] Table style fixes (#14691)
coreymartin Jan 6, 2025
4c10e4e
[uma-bridge] Better types for translations. Localize date format when…
coreymartin Jan 7, 2025
2a3eadf
Added `isFullCount` to `DataManagerTable`. (#14273)
mhrheaume Jan 9, 2025
bf87907
Simplify isFullCount in DataManagerTable. (#14764)
mhrheaume Jan 9, 2025
221adf0
[stablecoin-issuance] onhover that highlights background of td elems …
ch-brian Jan 9, 2025
48a469e
[ui] Simplify Table hover state styles (#14742)
coreymartin Jan 10, 2025
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
6 changes: 6 additions & 0 deletions .changeset/little-hats-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lightsparkdev/core": patch
"@lightsparkdev/ui": patch
---

- Test changeset
16 changes: 2 additions & 14 deletions apps/examples/ui-test-app/src/tests/Banner.test.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import { ThemeProvider } from "@emotion/react";
import { Banner } from "@lightsparkdev/ui/components";
import { themes } from "@lightsparkdev/ui/styles/themes";
import { link } from "@lightsparkdev/ui/utils/toReactNodes/nodes";
import { screen, render as tlRender, waitFor } from "@testing-library/react";
import type { ReactElement, ReactNode } from "react";
import { screen, waitFor } from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";
import { TestAppRoutes } from "../types";

function Providers({ children }: { children: ReactNode }) {
return <ThemeProvider theme={themes.dark}>{children}</ThemeProvider>;
}

function render(renderElement: ReactElement) {
return tlRender(renderElement, {
wrapper: Providers,
});
}
import { render } from "./render";

describe("Banner", () => {
test("should properly infer argument types and raise errors for invalid values", async () => {
Expand Down
21 changes: 2 additions & 19 deletions apps/examples/ui-test-app/src/tests/CodeInput.test.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
import { ThemeProvider } from "@emotion/react";
import { jest } from "@jest/globals";
import { CodeInput } from "@lightsparkdev/ui/components/CodeInput/CodeInput";
import { themes } from "@lightsparkdev/ui/styles/themes";
import {
fireEvent,
screen,
render as tlRender,
waitFor,
} from "@testing-library/react";
import { type ReactElement, type ReactNode } from "react";

function Providers({ children }: { children: ReactNode }) {
return <ThemeProvider theme={themes.dark}>{children}</ThemeProvider>;
}

function render(renderElement: ReactElement) {
return tlRender(renderElement, {
wrapper: Providers,
});
}
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { render } from "./render";

describe("CodeInput", () => {
beforeEach(() => {
Expand Down
163 changes: 163 additions & 0 deletions apps/examples/ui-test-app/src/tests/NumberInput.core.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import { jest } from "@jest/globals";
import { NumberInput } from "@lightsparkdev/ui/components/NumberInput";
import "@testing-library/jest-dom";
import { fireEvent, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { render } from "./render";

describe("NumberInput core", () => {
const onChangeSpy = jest.fn();

beforeEach(() => {
jest.clearAllMocks();
});

it("Renders without error", () => {
render(
<NumberInput
id="validationCustom01"
name="inputName"
placeholder="£1,000"
value=""
onChange={() => {}}
/>,
);
const input = screen.getByRole("textbox");

expect(input).toHaveValue("");
});

it("Renders with value", () => {
render(<NumberInput value="1234.56" prefix="£" onChange={() => {}} />);
const input = screen.getByRole("textbox");

expect(input).toHaveValue("£1,234.56");
});

it("Renders with value 0", () => {
render(<NumberInput value="0" prefix="£" onChange={() => {}} />);

expect(screen.getByRole("textbox")).toHaveValue("£0");
});

it("Renders with value 0 with decimalScale 2", () => {
render(
<NumberInput value="0" decimalScale={2} prefix="£" onChange={() => {}} />,
);

expect(screen.getByRole("textbox")).toHaveValue("£0.00");
});

it("Renders with value prop", () => {
render(<NumberInput value="49.99" prefix="£" onChange={() => {}} />);

expect(screen.getByRole("textbox")).toHaveValue("£49.99");
});

it("Renders with value 0.1 with decimalScale 2", async () => {
render(
<NumberInput
value="0.1"
prefix="£"
decimalScale={2}
onChange={() => {}}
/>,
);

expect(screen.getByRole("textbox")).toHaveValue("£0.10");

await userEvent.type(screen.getByRole("textbox"), "{backspace}");

expect(screen.getByRole("textbox")).toHaveValue("£0.1");
});

it("should prefix 0 value", () => {
render(<NumberInput prefix="£" value="0" onChange={onChangeSpy} />);

expect(screen.getByRole("textbox")).toHaveValue("£0");
});

it("should allow empty value", async () => {
const { rerender } = render(
<NumberInput prefix="£" onChange={onChangeSpy} value="1" />,
);
await userEvent.clear(screen.getByRole("textbox"));

expect(onChangeSpy).toHaveBeenLastCalledWith("", {
float: null,
formatted: "",
value: "",
});
rerender(<NumberInput prefix="£" onChange={onChangeSpy} value="" />);
expect(screen.getByRole("textbox")).toHaveValue("");
});

it("should not allow invalid characters", async () => {
render(<NumberInput prefix="£" value="" onChange={onChangeSpy} />);
await userEvent.type(screen.getByRole("textbox"), "hello");

expect(onChangeSpy).toHaveBeenLastCalledWith("", {
float: null,
formatted: "",
value: "",
});

expect(screen.getByRole("textbox")).toHaveValue("");
});

it("should clear decimal point only input", async () => {
render(<NumberInput prefix="£" value="" onChange={onChangeSpy} />);
await userEvent.type(screen.getByRole("textbox"), ".");

expect(onChangeSpy).toHaveBeenLastCalledWith("", {
float: null,
formatted: "",
value: "",
});

fireEvent.focusOut(screen.getByRole("textbox"));
expect(screen.getByRole("textbox")).toHaveValue("");
});

it("should allow .3 decimal inputs", async () => {
const { rerender } = render(
<NumberInput prefix="£" value="" onChange={onChangeSpy} />,
);
await userEvent.type(screen.getByRole("textbox"), ".3");

expect(onChangeSpy).toHaveBeenLastCalledWith(".3", {
float: 0.3,
formatted: "£0.3",
value: ".3",
});

rerender(<NumberInput prefix="£" value=".3" onChange={onChangeSpy} />);
fireEvent.focusOut(screen.getByRole("textbox"));
expect(screen.getByRole("textbox")).toHaveValue("£0.3");
});

it("should update the input when prop value changes to another number", () => {
const { rerender } = render(
<NumberInput
value="1"
placeholder="Please enter a number"
prefix="£"
onChange={() => {}}
/>,
);

const field = screen.getByRole("textbox");
expect(field).toHaveValue("£1");

rerender(
<NumberInput
value="2"
placeholder="Please enter a number"
prefix="£"
onChange={() => {}}
/>,
);

expect(field).toHaveValue("£2");
});
});
Loading
Loading