-
Notifications
You must be signed in to change notification settings - Fork 9
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
Various Helm Chart maintenance updates #158
Changes from all commits
c9ad48a
a8cd4c7
79d87ca
4fc835e
340fad0
1ede154
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ const crypto = require('crypto'); | |
const jestJoi = require('jest-joi'); | ||
expect.extend(jestJoi.matchers); | ||
|
||
const { Permissions } = require('../../../src/components/constants'); | ||
const { EMAILREGEX, Permissions } = require('../../../src/components/constants'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just wondering, if BCBox needs to validate the email address .. so that it only calls the COMS search endpoint once the email is valid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is part of Kyle's PR. The regex is being backported from BCBox to here so that it remains in alignment - the Joi email definition isn't sufficiently meeting our needs. |
||
const { scheme, type } = require('../../../src/validators/common'); | ||
|
||
describe('type', () => { | ||
|
@@ -50,7 +50,6 @@ describe('type', () => { | |
|
||
describe('email', () => { | ||
const model = type.email.describe(); | ||
|
||
it('is a string', () => { | ||
expect(model).toBeTruthy(); | ||
expect(model.type).toEqual('string'); | ||
|
@@ -60,14 +59,18 @@ describe('type', () => { | |
expect(Array.isArray(model.rules)).toBeTruthy(); | ||
expect(model.rules).toHaveLength(2); | ||
expect(model.rules).toEqual(expect.arrayContaining([ | ||
expect.objectContaining( | ||
{ | ||
'args': { | ||
'limit': 255 | ||
}, | ||
'name': 'max' | ||
expect.objectContaining({ | ||
'args': { | ||
'regex': new RegExp(EMAILREGEX).toString() | ||
}, | ||
'name': 'pattern' | ||
}), | ||
expect.objectContaining({ | ||
'args': { | ||
'limit': 255 | ||
}, | ||
{ 'name': 'email' }) | ||
'name': 'max' | ||
}) | ||
])); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering would be better to define the constant like: "EMAIL_REGEX" instead as combined (one word)? In the future we will have a multiple word constant, it might look nicer to split by _