From 8ae551ea28fb319c733d802607b30509c5fa3bf6 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Thu, 26 Dec 2024 15:02:02 +0700 Subject: [PATCH] Add filters tests --- client/data/transactions/resolvers.js | 2 +- client/transactions/filters/index.tsx | 2 +- .../filters/test/__snapshots__/index.tsx.snap | 20 +++++++ client/transactions/filters/test/index.tsx | 54 +++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/client/data/transactions/resolvers.js b/client/data/transactions/resolvers.js index ff7c2e3561f..37b1c94fb0d 100644 --- a/client/data/transactions/resolvers.js +++ b/client/data/transactions/resolvers.js @@ -55,7 +55,7 @@ export const formatQueryFilters = ( query ) => ( { customer_currency_is: query.customerCurrencyIs, customer_currency_is_not: query.customerCurrencyIsNot, source_is: query.sourceIs, - source_is_not: query.sourceIsNot, // @todo check why? + source_is_not: query.sourceIsNot, search: query.search, user_timezone: getUserTimeZone(), locale: query.locale, diff --git a/client/transactions/filters/index.tsx b/client/transactions/filters/index.tsx index 185ab4e119e..b468f0c5bed 100644 --- a/client/transactions/filters/index.tsx +++ b/client/transactions/filters/index.tsx @@ -17,7 +17,7 @@ import { Transaction } from 'wcpay/data'; interface TransactionsFiltersProps { storeCurrencies: string[]; customerCurrencies: string[]; - transactionSources?: Transaction[ 'source' ][]; + transactionSources: Transaction[ 'source' ][]; } export const TransactionsFilters = ( { diff --git a/client/transactions/filters/test/__snapshots__/index.tsx.snap b/client/transactions/filters/test/__snapshots__/index.tsx.snap index b8aefe7a57b..a2a2a7bd3da 100644 --- a/client/transactions/filters/test/__snapshots__/index.tsx.snap +++ b/client/transactions/filters/test/__snapshots__/index.tsx.snap @@ -55,6 +55,26 @@ HTMLOptionsCollection [ ] `; +exports[`Transactions filters when filtering by payment method should render all types 1`] = ` +HTMLOptionsCollection [ + , + , + , +] +`; + exports[`Transactions filters when filtering by risk level should render all types 1`] = ` HTMLOptionsCollection [