Skip to content

Commit

Permalink
Sc 63647/submission of json objects to string fields (#171)
Browse files Browse the repository at this point in the history
* Add string validation and 'format is valid/invalid' operators to last_name and city
  • Loading branch information
henriquelakiap committed Apr 12, 2024
1 parent f211845 commit 7bcc597
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/types/city.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module.exports = {
'is not equal to',
'is blank',
'is not blank',
'format is valid',
'format is invalid',
'includes',
'does not include',
'is included in',
Expand Down
2 changes: 2 additions & 0 deletions lib/types/last_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module.exports = {
'is not equal to',
'is blank',
'is not blank',
'format is valid',
'format is invalid',
'matches pattern',
'does not match pattern'
],
Expand Down
17 changes: 17 additions & 0 deletions test/city.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,21 @@ describe('City', function () {
assert.equal(parsed.raw, '[object Object]');
assert.isFalse(parsed.valid);
});

it('should have the expected operators', function () {
assert(city.operators, [
'is equal to',
'is not equal to',
'is blank',
'is not blank',
'format is valid',
'format is invalid',
'includes',
'does not include',
'is included in',
'is not included in',
'matches pattern',
'does not match pattern'
]);
});
});
13 changes: 13 additions & 0 deletions test/first-name.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,17 @@ describe('First Name', function () {
assert.equal(parsed.raw, '[object Object]');
assert.isFalse(parsed.valid);
});

it('should have the expected operators', function () {
assert.deepEqual(firstName.operators, [
'is equal to',
'is not equal to',
'is blank',
'is not blank',
'format is valid',
'format is invalid',
'matches pattern',
'does not match pattern'
]);
});
});
13 changes: 13 additions & 0 deletions test/last-name.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,17 @@ describe('Last Name', function () {
assert.equal(parsed.raw, '[object Object]');
assert.isFalse(parsed.valid);
});

it('should have the expected operators', function () {
assert.deepEqual(lastName.operators, [
'is equal to',
'is not equal to',
'is blank',
'is not blank',
'format is valid',
'format is invalid',
'matches pattern',
'does not match pattern'
]);
});
});

0 comments on commit 7bcc597

Please sign in to comment.