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 jest tests due to daylight saving #5065

Merged
merged 2 commits into from
Nov 8, 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
4 changes: 4 additions & 0 deletions changelog/fix-jest-timezone-nov-2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev


4 changes: 2 additions & 2 deletions client/data/transactions/test/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe( 'getTransactions resolver', () => {
'page=1&pagesize=25&sort=date&direction=desc' +
'&match=all&date_before=2020-04-29%2003%3A59%3A59&date_after=2020-04-29%2004%3A00%3A00' +
'&date_between%5B0%5D=2020-04-28%2004%3A00%3A00&date_between%5B1%5D=2020-04-30%2003%3A59%3A59&type_is=charge' +
'&type_is_not=dispute&loan_id_is=mock_flxln_id&deposit_id=mock_po_id&search=Test%20user&user_timezone=-04%3A00';
'&type_is_not=dispute&loan_id_is=mock_flxln_id&deposit_id=mock_po_id&search=Test%20user&user_timezone=-05%3A00';
let generator = null;

beforeEach( () => {
Expand Down Expand Up @@ -89,7 +89,7 @@ describe( 'getTransactionsSummary resolver', () => {
const expectedQueryString =
'match=all&date_before=2020-04-29%2003%3A59%3A59&date_after=2020-04-29%2004%3A00%3A00' +
'&date_between%5B0%5D=2020-04-28%2004%3A00%3A00&date_between%5B1%5D=2020-04-30%2003%3A59%3A59&type_is=charge' +
'&type_is_not=dispute&loan_id_is=mock_flxln_id&deposit_id=mock_po_id&search=Test%20user&user_timezone=-04%3A00';
'&type_is_not=dispute&loan_id_is=mock_flxln_id&deposit_id=mock_po_id&search=Test%20user&user_timezone=-05%3A00';
let generator = null;

beforeEach( () => {
Expand Down
4 changes: 2 additions & 2 deletions client/transactions/list/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ describe( 'Transactions list', () => {
expect( mockApiFetch ).toHaveBeenCalledWith( {
method: 'POST',
path:
'/wc/v3/payments/transactions/download?user_email=mock%40example.com&user_timezone=-04%3A00',
'/wc/v3/payments/transactions/download?user_email=mock%40example.com&user_timezone=-05%3A00',
} );
} );
} );
Expand Down Expand Up @@ -575,7 +575,7 @@ describe( 'Transactions list', () => {
expect( mockApiFetch ).toHaveBeenCalledWith( {
method: 'POST',
path:
'/wc/v3/payments/transactions/download?user_email=mock%40example.com&deposit_id=po_mock&user_timezone=-04%3A00',
'/wc/v3/payments/transactions/download?user_email=mock%40example.com&deposit_id=po_mock&user_timezone=-05%3A00',
} );
} );
} );
Expand Down