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

feat: transaction list revamp #2744

Merged
merged 50 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
61e979e
feat: new transaction list
reneaaron Sep 8, 2023
598e356
fix: remove unused badges
reneaaron Sep 8, 2023
034afdb
fix: detail view
reneaaron Sep 8, 2023
ae79520
modify transaction list heading and align it to center at all places
pavanjoshi914 Sep 20, 2023
b61b914
feat: unify transaction list
pavanjoshi914 Sep 21, 2023
62b00ab
feat: redesign sats showcase
pavanjoshi914 Sep 21, 2023
95ec2b0
feat: keep sats word in the currencty converter itself
pavanjoshi914 Sep 22, 2023
b96acbc
feat: add payment hash in transaction model
pavanjoshi914 Sep 25, 2023
5e617df
feat: add show more button
pavanjoshi914 Sep 26, 2023
80a5490
feat: add boostagram details
pavanjoshi914 Sep 26, 2023
314febc
feat: cleanup regex keep same color for now
pavanjoshi914 Sep 26, 2023
ce2980e
chore: resolve conflict
pavanjoshi914 Sep 26, 2023
21df7e3
feat: refactor transaction modal
pavanjoshi914 Sep 27, 2023
2ba13e2
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 3, 2023
3092cf4
feat: add getTransactions Method
pavanjoshi914 Oct 3, 2023
ef18f75
chore: some improvements
pavanjoshi914 Oct 3, 2023
045a494
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 4, 2023
4cd5951
chore: proper error handling
pavanjoshi914 Oct 4, 2023
fa27b14
feat: add strokes to the icons
pavanjoshi914 Oct 4, 2023
f5dd239
fix: style improvements
reneaaron Oct 4, 2023
7688615
fix: spacing improvements
reneaaron Oct 9, 2023
4a1eed4
fix: translations & layout improvements
reneaaron Oct 11, 2023
db98c00
fix: translations
reneaaron Oct 11, 2023
e3d799f
Merge branch 'master' into feat/transaction-list
reneaaron Oct 11, 2023
ce6fdad
fix: modal usage, remove headings
reneaaron Oct 11, 2023
f757e35
fix: modal & colors
reneaaron Oct 12, 2023
bf48967
fix: cleanup modal
reneaaron Oct 12, 2023
45c3a4b
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 17, 2023
221e505
Merge branch 'feat/transaction-list' of https://github.com/getAlby/li…
pavanjoshi914 Oct 17, 2023
65ff245
feat: use new invoices method to fetch all transactions at once
pavanjoshi914 Oct 17, 2023
2a6543a
feat: implement getTransactions method for
pavanjoshi914 Oct 25, 2023
0290101
feat: lnbits get transactions method
pavanjoshi914 Oct 25, 2023
d30059a
feat: cleanup useTransactions hook
pavanjoshi914 Oct 26, 2023
20bf68a
chore: cleanup unused var
pavanjoshi914 Oct 26, 2023
e4b34b6
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 27, 2023
3aea615
Merge branch 'master' into feat/transaction-list
reneaaron Oct 30, 2023
393c553
fix: break long content w/o whitespaces in modal
reneaaron Oct 30, 2023
52e56a2
fix: remove sorting in hook
reneaaron Oct 30, 2023
88a93ee
fix: prevent duplicate loading of transactions, spacing
reneaaron Oct 30, 2023
32e17a0
fix: add payment hash, cleanup
reneaaron Oct 30, 2023
8d380d8
fix: reset showMore when transaction changes to avoid flicker
reneaaron Oct 31, 2023
e56e496
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Nov 1, 2023
cb9755e
Merge branch 'feat/transaction-list' of https://github.com/getAlby/li…
pavanjoshi914 Nov 1, 2023
6c784cc
chore: cleaning up
pavanjoshi914 Nov 1, 2023
7984fd5
feat: get rid of invoice type
pavanjoshi914 Nov 1, 2023
ab520d8
feat: rename getTransactions action and message types
pavanjoshi914 Nov 6, 2023
177acf2
feat: filter transactions without isSettled
pavanjoshi914 Nov 6, 2023
9226f65
feat: cleanup connector GetTransactions method
pavanjoshi914 Nov 6, 2023
796fbbb
fix: decode preimage & payment_hash
reneaaron Nov 9, 2023
58cd64d
Merge branch 'master' into feat/transaction-list
reneaaron Nov 9, 2023
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
2 changes: 1 addition & 1 deletion src/app/components/PaymentSummary/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PaymentSummary, { Props } from "@components/PaymentSummary";
import { render, screen, act } from "@testing-library/react";
import { act, render, screen } from "@testing-library/react";
import { I18nextProvider } from "react-i18next";
import { BrowserRouter } from "react-router-dom";
import { settingsFixture as mockSettings } from "~/../tests/fixtures/settings";
Expand Down
44 changes: 9 additions & 35 deletions src/app/components/TransactionsTable/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { act } from "react-dom/test-utils";
import { I18nextProvider } from "react-i18next";
import { BrowserRouter } from "react-router-dom";
import { settingsFixture as mockSettings } from "~/../tests/fixtures/settings";
import i18n from "~/../tests/unit/helpers/i18n";
import { SettingsProvider } from "~/app/context/SettingsContext";

import TransactionsTable from ".";
import type { Props } from ".";
import TransactionsTable from ".";

jest.mock("~/common/lib/api", () => {
const original = jest.requireActual("~/common/lib/api");
Expand All @@ -22,6 +20,7 @@ jest.mock("~/common/lib/api", () => {
const transactions: Props = {
transactions: [
{
timestamp: 1656573909064,
createdAt: "1656573909064",
date: "5 days ago",
description: "Polar Invoice for bob",
Expand All @@ -44,6 +43,7 @@ const invoices: Props = {
transactions: [
{
id: "lnbcrt666660n1p3tad0hpp5kkguywerj5lqspc4p2a7f53yfnkuywxmxnuawe3lu4gdg0ezc2tqdqjd3sk6cn0ypkxzmtzducqzpgxqyz5vqsp529wvk52ckjkrfkll9q3w6ep6lrsg35se66jjpm5ssmumck7xxy6s9qyyssqzq3zsstfs7gzklgkdnxy2hsp4jfavw8xj4hv5300yww3053jx76h57e3ypsuvg36zwd49xm2nfr2lrfvylwrxs7yhpckjytvlaju0hsq7p9wna",
timestamp: 1656573909064,
type: "received",
totalAmount: "66666",
totalAmountFiat: "$13.02",
Expand All @@ -53,6 +53,7 @@ const invoices: Props = {
},
{
id: "lnbcrt6543210n1p3tadjepp5rv6ufq4vumg66l9gcyxqhy89n6w90mx0mh6gcj0sawrf6xuep5ssdq5g9kxy7fqd9h8vmmfvdjscqzpgxqyz5vqsp5f9yzxeqjw33ule4rffuh0py32gjjsx8z48cd4xjl8ej3rn7zdtdq9qyyssqe6qvkfe260myc9ypgs5n63xzwcx82fderg8p5ysh6c2fvpz5xu4ksvhs5av0wwestk5pmucmhk8lpjhmy7wqyq9c29xgm9na2q5xv5spy5kukj",
timestamp: 1656573909064,
type: "received",
totalAmount: "654321",
totalAmountFiat: "$127.80",
Expand All @@ -67,6 +68,7 @@ const invoicesWithBoostagram: Props = {
transactions: [
{
id: "lnbcrt666660n1p3tad0hpp5kkguywerj5lqspc4p2a7f53yfnkuywxmxnuawe3lu4gdg0ezc2tqdqjd3sk6cn0ypkxzmtzducqzpgxqyz5vqsp529wvk52ckjkrfkll9q3w6ep6lrsg35se66jjpm5ssmumck7xxy6s9qyyssqzq3zsstfs7gzklgkdnxy2hsp4jfavw8xj4hv5300yww3053jx76h57e3ypsuvg36zwd49xm2nfr2lrfvylwrxs7yhpckjytvlaju0hsq7p9wna",
timestamp: 1656573909064,
type: "received",
totalAmount: "66666",
totalAmountFiat: "$13.02",
Expand All @@ -76,6 +78,7 @@ const invoicesWithBoostagram: Props = {
},
{
id: "lnbcrt888880n1p3tad30pp56j6g34wctydrfx4wwdwj3schell8uqug6jnlehlkpw02mdfd9wlqdq0v36k6urvd9hxwuccqzpgxqyz5vqsp5995q4egstsvnyetwvpax6jw8q0fnn4tyz3gp35k3yex29emhsylq9qyyssq0yxpx6peyn4vsepwj3l68w9sc5dqnkt07zff6aw4kqvcfs0fpu4jpfh929w6vqrgtjfkmrlwghq4s9t4mnwrh4dlkm6wjem5uq8eu4gpwqln0j",
timestamp: 1656573909064,
type: "received",
totalAmount: "88888",
totalAmountFiat: "$17.36",
Expand Down Expand Up @@ -103,8 +106,6 @@ const invoicesWithBoostagram: Props = {

describe("TransactionsTable", () => {
test("renders transactions", async () => {
const user = userEvent.setup();

render(
<BrowserRouter>
<I18nextProvider i18n={i18n}>
Expand All @@ -117,17 +118,8 @@ describe("TransactionsTable", () => {

expect(screen.getByText("Alby")).toBeInTheDocument();
expect(screen.getByText(/5 days ago/)).toBeInTheDocument();
expect(await screen.findByText(/-1,234,000 sats/)).toBeInTheDocument();
expect(await screen.findByText(/- 1,234,000 sats/)).toBeInTheDocument();
expect(await screen.findByText(/~\$241.02/)).toBeInTheDocument();

const disclosureButton = screen.getByRole("button");

await act(() => {
user.click(disclosureButton);
});

expect(await screen.findByText("0 sats")).toBeInTheDocument();
expect(await screen.findByText(/Open website/)).toBeInTheDocument();
});

test("renders invoice without boostagram", async () => {
Expand All @@ -143,16 +135,14 @@ describe("TransactionsTable", () => {

expect(await screen.findByText("lambo lambo")).toBeInTheDocument();
expect(await screen.findByText(/4 days ago/)).toBeInTheDocument();
expect(await screen.findByText(/\+66,666 sats/)).toBeInTheDocument();
expect(await screen.findByText(/\+ 66,666 sats/)).toBeInTheDocument();
expect(await screen.findByText(/~\$13.02/)).toBeInTheDocument();

const disclosureButtons = screen.queryByRole("button");
expect(disclosureButtons).not.toBeInTheDocument();
});

test("renders invoice with boostagram", async () => {
const user = userEvent.setup();

render(
<BrowserRouter>
<I18nextProvider i18n={i18n}>
Expand All @@ -165,23 +155,7 @@ describe("TransactionsTable", () => {

expect(screen.getByText("dumplings")).toBeInTheDocument();
expect(screen.getByText(/5 days ago/)).toBeInTheDocument();
expect(await screen.findByText(/\+88,888 sats/)).toBeInTheDocument();
expect(await screen.findByText(/\+ 88,888 sats/)).toBeInTheDocument();
expect(await screen.findByText(/~\$17.36/)).toBeInTheDocument();

const disclosureButtons = screen.getAllByRole("button");
expect(disclosureButtons).toHaveLength(1);

await act(() => {
user.click(disclosureButtons[0]);
});

expect(
await screen.findByText(/Message: Du bist so 1 geiles podcast 100%/)
).toBeInTheDocument();
expect(
await screen.findByText(/Sender: bumi@getalby.com/)
).toBeInTheDocument();
expect(await screen.findByText(/App: Fountain/)).toBeInTheDocument();
expect(await screen.findByText(/Podcast: Honigdachs/)).toBeInTheDocument();
});
});
Loading
Loading