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

[test] update the recipe #1362

Merged
merged 3 commits into from
Apr 27, 2024
Merged

[test] update the recipe #1362

merged 3 commits into from
Apr 27, 2024

Conversation

UlianaPurtova
Copy link
Contributor

unit tests for updating the recipe

imageIds: [],
folder: "main",
});
expect(response.title).toEqual("marmelad");
Copy link
Owner

Choose a reason for hiding this comment

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

Would be good to query the DB again and check that it was properly updated in the database

});
});
describe("error", () => {
it("can not update unexisting recipe", async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Would rename this case to throws an error when updating a recipe that does not exist

}).rejects.toThrow("Recipe not found");
return tearDown(user2.id);
});
it("must throw on invalid ownership", async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Would suggest renaming this case to throws an error when updating a recipe with label ids the user does not own

return tearDown(user2.id);
});

it("allows to update recipe with image", async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

This should be moved to the success section rather than the error section

@julianpoy
Copy link
Owner

Thanks for the PR! A few comments, but otherwise looks great!

@julianpoy julianpoy merged commit 790851e into julianpoy:master Apr 27, 2024
2 checks passed
@julianpoy
Copy link
Owner

Thanks for the PR!

@UlianaPurtova UlianaPurtova deleted the uli branch April 29, 2024 20:21
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.

2 participants