-
Notifications
You must be signed in to change notification settings - Fork 1
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 future-date test from articles-post file #97
Comments
@Slawomir-DKl can you please double check on Your side? |
@kat-kan You're right. In the latest version of GAD (2.6.5) the date validation patterns were fixed - see the Release notes. Therefore we can leave |
@Slawomir-DKl thank You for checking this, indeed it's mentioned in release notes, I didn't notice |
@kat-kan Nice solution. Thanks to this we can test for future changes in the GAD. |
@Slawomir-DKl I've just added Your suggestion :) |
✏️ Description
Method
toISOString()
creates a date in the format with milliseconds, and GAD requires a format without milliseconds. Therefore the test is always green, regardless of the operator used in the linedate.setFullYear(date.getFullYear() + 1);
(you can change + with - and still get the 422 code, even if the date is from the past).The solution is to add
.split('.')[0] + 'Z'
after thetoISOString()
method, e.g.:Instead we could use the variables
customDate.pastDate
andcustomDate.futureDate
I've created in Pull Request no. 96 (of course, after merging the latter PR into main branch)✅ Problem report checklist
The text was updated successfully, but these errors were encountered: