-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PP 11877 Validate date range entry on the transaction search page (#4162
) When searching for transactions in SelfService between two dates, if the start date entered is later than the end date, no transactions are listed. We should be rendering an error here to show the user the input mistake and how to rectify it. This fix is done on both the transactions and the all services transactions search pages. New cypress, non-cypress integration test and standard unit tests were written to cover the new validation functionality implemented.
- Loading branch information
Showing
10 changed files
with
193 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,6 +334,51 @@ describe('Transactions List', () => { | |
assertTransactionRow(1, filteredByMultipleFieldsTransactions[1].reference, `/account/${gatewayAccountExternalId}/transactions/payment-transaction-id2`, | ||
'[email protected]', '–£15.00', 'Visa', 'Refund submitted') | ||
}) | ||
|
||
it('should display error message when searching with from date later than to date', () => { | ||
cy.task('setupStubs', [ | ||
...sharedStubs(), | ||
transactionsStubs.getLedgerTransactionsSuccess({ gatewayAccountId, transactions: unfilteredTransactions }), | ||
transactionsStubs.getLedgerTransactionsSuccess({ | ||
gatewayAccountId, | ||
transactions: filteredByDatesTransactions, | ||
filters: { | ||
from_date: '2018-05-03T00:00:00.000Z', | ||
to_date: '2018-05-03T00:00:01.000Z' | ||
} | ||
}) | ||
]) | ||
cy.visit(transactionsUrl) | ||
|
||
cy.get('.datepicker').should('not.exist') | ||
cy.get('.ui-timepicker-wrapper').should('not.exist') | ||
|
||
cy.get('#fromDate').type('03/5/2018') | ||
|
||
cy.get('.datepicker').should('be.visible') | ||
cy.get('.ui-timepicker-wrapper').should('not.exist') | ||
|
||
cy.get('#fromTime').type('01:00:00') | ||
|
||
cy.get('.datepicker').should('not.exist') | ||
cy.get('.ui-timepicker-wrapper').should('be.visible') | ||
|
||
cy.get('#toDate').type('02/5/2018') | ||
|
||
cy.get('.datepicker').should('be.visible') | ||
cy.get('.ui-timepicker-wrapper').should('not.be.visible') | ||
|
||
cy.get('#toTime').type('01:00:00') | ||
|
||
cy.get('.datepicker').should('not.exist') | ||
cy.get('.ui-timepicker-wrapper').should('be.visible') | ||
|
||
cy.get('#filter').click() | ||
|
||
cy.get('#transactions-list tbody').should('not.exist') | ||
|
||
cy.get('h3').contains('End date must be after start date' ) | ||
}) | ||
}) | ||
describe('Transactions are displayed correctly', () => { | ||
it('should display card fee with corporate card surcharge transaction', () => { | ||
|