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

Add unit tests for related entities on the generated app #397

Open
1 task done
ivanmonteiro opened this issue Sep 30, 2020 · 2 comments
Open
1 task done

Add unit tests for related entities on the generated app #397

ivanmonteiro opened this issue Sep 30, 2020 · 2 comments
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: server ⚙️ theme: test up-for-grabs $100 https://www.jhipster.tech/bug-bounties/

Comments

@ivanmonteiro
Copy link
Contributor

Overview of the feature request

Add unit tests for related entities on the generated dotnet application.

As an example:
Unit tests for Employee should test adding and removing its Department relationship.

Motivation for or Use Case

Currently the unit tests only adds/removes the main entity.
Changes to the generator may cause issues regarding relationships and are not caught by tests.
This is important to make sure that new PR's are not breaking relationship functionality at this project.

Related issues or PR
  • Checking this box is mandatory (this is just to show you read everything)
@kennethlong
Copy link
Contributor

Does the Java template generate these test? I was going to peek at the implementation if it does.

@ivanmonteiro
Copy link
Contributor Author

Does the Java template generate these test? I was going to peek at the implementation if it does.

Last time I checked the main Jhipster generator didn't generate tests for relationships.
Currently the tests only check if relationship is required.

The idea would be to create unit tests that:

  • creates the main entity
  • also creates the dependant entities
  • saves the entity graph to the database
  • verifies that all entities were created/updated
  • also deletes dependant entities and checks if it was properly deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: server ⚙️ theme: test up-for-grabs $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

No branches or pull requests

3 participants