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

Tests for vocabulary-dataset relationship CRUD operations #4

Merged
merged 15 commits into from Nov 22, 2019

Conversation

ikas
Copy link
Contributor

@ikas ikas commented Nov 19, 2019

No description provided.

@ikas ikas requested a review from tiagojsag November 19, 2019 15:20
Copy link
Contributor

@tiagojsag tiagojsag left a comment

Choose a reason for hiding this comment

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

Left you a few notes throughout the code. A couple more thing I think can be improved:

  • I saw a lot of "...should be successful" on the test case name. IMO those should be made clearer, like "...should return a HTTP code 200 and the dataset object" so it's clear what "success" means in each case
  • I see you commented your code thoroughly, which is great, but perhaps we don't need these many comments. Save them for more convoluted lines, where the behavior is not directly clear, or there's a weird reason why the code has to be that way. This is more of a time saver than a deal-breaker, feel free to document as much as you want if you want, no objections from me on that ;)

app/src/models/vocabulary.model.js Outdated Show resolved Hide resolved
app/test/e2e/utils.js Outdated Show resolved Hide resolved
app/test/e2e/utils.js Outdated Show resolved Hide resolved
app/test/e2e/utils.js Outdated Show resolved Hide resolved
app/test/e2e/vocabulary-dataset.spec.js Outdated Show resolved Hide resolved
app/test/e2e/vocabulary-dataset.spec.js Outdated Show resolved Hide resolved
@tiagojsag tiagojsag changed the base branch from hp-update-eslint to develop November 21, 2019 17:14
});

after(async () => {
await Resource.deleteMany().exec();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move all of these from before to beforeEach and from after to afterEach? Initially, I had it like this, but then JS's asynchronous nature came to bite me in the ass, as things were happening in weird orders. Thus I started moving towards cleaning up the model in between tests, to ensure all of them are self contained, and dont depend on each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, had to make some changes in the find-by-ids test suite, but it was an easy change 👍

@tiagojsag tiagojsag merged commit 846870b into develop Nov 22, 2019
@tiagojsag tiagojsag deleted the hp-vocabulary-tests branch November 22, 2019 10:45
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.

None yet

2 participants