Skip to content

Commit

Permalink
#2484: trim the string prior validation
Browse files Browse the repository at this point in the history
  • Loading branch information
EVOFORGE\dimay authored and dwalizer committed Nov 27, 2023
1 parent 1f0c269 commit c047d86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/validators/NotNullValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { extend } from 'vee-validate';
const validator = {
message: (field) => `Null is not allowed for ${field}`,
validate(value) {
return !value || value.toLowerCase() !== 'null';
return !value || value.trim().toLowerCase() !== 'null';
},
};

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/cypress/e2e/projects_modal_validation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ describe('Projects Modal Validation Tests', () => {
cy.get('[data-cy=projectNameError]').should('not.be.visible')
cy.get('[data-cy=idError]').should('not.be.visible')

// verify validator is case insensitive
// verify validator is case-insensitive and trims whitespace
cy.get('[data-cy="projectName"]').clear()
.type('NUlL');
.type(' NUlL ');
cy.get('[data-cy=projectNameError]')
.contains('Null is not allowed for Project Name')
.should('be.visible');
Expand Down

0 comments on commit c047d86

Please sign in to comment.