-
-
Notifications
You must be signed in to change notification settings - Fork 279
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: convert collectionType to appropiate format before param-validation #510
fix: convert collectionType to appropiate format before param-validation #510
Conversation
5d9f94a
to
6c3aff8
Compare
6c3aff8
to
4303792
Compare
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.
Good fix.
I love that there's tests to go with it :)
test/src/server/routes/collection.js
Outdated
expect(collection.get('id')).to.equal(res.body.id); | ||
expect(collection.get('ownerId')).to.equal(collectionOwner.get('id')); | ||
expect(collection.get('name')).to.equal(data.name); | ||
expect(collection.get('entityType')).to.equal(_.upperFirst(_.camelCase(data.entityType))); |
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.
Let's change the expectation specifically to what we expect it to be, 'EditionGroup'.
That way if anything changes and we don't receive 'EditionGroup' we'll know something is wrong.
test/src/server/routes/collection.js
Outdated
|
||
expect(res.status).to.equal(200); | ||
expect(updatedCollectionJSON.name).to.equal(newData.name); | ||
expect(updatedCollectionJSON.entityType).to.equal(_.upperFirst(_.camelCase(newData.entityType))); |
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.
Same comment as above
693fc2a
to
8f22779
Compare
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.
Great !
Problem
An error was occurring while creating Edition-Group collection.
Solution
In the
paramValidation
middleware, I forgot to take convert entityType tocamel-case
before validating it.Areas of Impact
src/server/helpers/middleware.js
test/src/server/routes/collection.js