From f9b976ee62f0320fa48bf27cc99516d4c592487e Mon Sep 17 00:00:00 2001 From: Miguel Gasca Date: Mon, 28 Oct 2024 15:12:50 +0100 Subject: [PATCH] Add unit test for Capital Loans page of WP Admin (#9638) --- changelog/dev-add-unit-tests-for-capital-list | 4 + .../test/__snapshots__/index.test.tsx.snap | 496 ++++++++++++++++++ client/capital/test/index.test.tsx | 107 ++++ 3 files changed, 607 insertions(+) create mode 100644 changelog/dev-add-unit-tests-for-capital-list create mode 100644 client/capital/test/__snapshots__/index.test.tsx.snap create mode 100644 client/capital/test/index.test.tsx diff --git a/changelog/dev-add-unit-tests-for-capital-list b/changelog/dev-add-unit-tests-for-capital-list new file mode 100644 index 00000000000..a99e92e7bbe --- /dev/null +++ b/changelog/dev-add-unit-tests-for-capital-list @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Add unit tests for the Capital Loans page component. diff --git a/client/capital/test/__snapshots__/index.test.tsx.snap b/client/capital/test/__snapshots__/index.test.tsx.snap new file mode 100644 index 00000000000..2b146dd5714 --- /dev/null +++ b/client/capital/test/__snapshots__/index.test.tsx.snap @@ -0,0 +1,496 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CapitalPage renders the TableCard component with loan data 1`] = ` +
+
+
+
+ Viewing test loans. To view live loans, disable test mode in + + WooPayments settings + + . +
+
+
+
+
+
+ Active loan overview +
+
+
+
+
+
+
+ Total repaid +
+
+ + $0.00 + + of $1,100.00 +
+
+
+
+ Repaid this period (until Dec 27, 2024) +
+
+ + $0.00 + + of $122.23 minimum +
+
+
+
+
+
+ Loan disbursed +
+
+ Oct 21, 2024 +
+
+
+
+ Loan amount +
+
+ $1,000.00 +
+
+
+
+ Fixed fee +
+
+ $100.00 +
+
+
+
+ Withhold rate +
+
+ 15 + % +
+
+
+
+ First paydown +
+
+ Oct 28, 2024 +
+
+
+
+
+