Skip to content
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

feat: add validation for the amount the tags being added #738

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

juanmahidalgo
Copy link
Contributor

No description provided.

@@ -73,6 +74,16 @@ export class ItemService {
)
: await Item.findOne<ItemAttributes>(item.id)

if (item.data.tags.length > MAX_TAGS_LENGTH) {
const isAlreadyExcided =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const isAlreadyExcided =
const isAlreadyExceeded =

})
describe('and the item already has the maximun amount of tags', () => {
it('should throw the MaximunAmountOfTagsReachedError error', () => {
return expect(() =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rejects modifier expects a promise, so It shouldn't be necessary to wrap the expectation on a function, would you mind removing it?

Suggested change
return expect(() =>
return expect(

@coveralls
Copy link

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8567333208

Details

  • 18 of 18 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 70.372%

Totals Coverage Status
Change from base Build 8542195029: 0.07%
Covered Lines: 2953
Relevant Lines: 4045

💛 - Coveralls

@juanmahidalgo juanmahidalgo merged commit 85b5c8a into master Apr 5, 2024
4 checks passed
@juanmahidalgo juanmahidalgo deleted the feat/tags-validation branch April 5, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants