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

Date validation easy renewals #2108

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ScottDormand96
Copy link
Collaborator

https://eaflood.atlassian.net/browse/IWTF-4378

Add the new date validation into easy renewals

https://eaflood.atlassian.net/browse/IWTF-4378

Add the new date validation into easy renewals
@ScottDormand96 ScottDormand96 added the enhancement New feature or request label Jan 7, 2025
@@ -44,7 +44,7 @@ jest.mock('../../../../routes/page-route.js')

const mockTransactionSet = jest.fn()

const getMockRequest = (permission = getSamplePermission(), year, month, day) => ({
const getMockRequest = (permission = getSamplePermission(), year, month, day, error) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is getting a bit too complex and should be changed to an object parameter. Looking at how you've used it in your new test, I think this would make things a bit simpler. Also, I think year, month and day should have default values.

},
'date-range': {
'date.min': { ref: '#licence-start-date-day', text: mssgs.renewal_start_date_error_min },
'date.max': { ref: '#licence-start-date-day', text: mssgs.renewal_start_date_error_max_1 + data.advancedPurchaseMaxDays + mssgs.renewal_start_date_error_max_2 + data.maxStartDate }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like something that should be in the getData function as it's a bit messy putting it together here, plus it's not testable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants