-
Notifications
You must be signed in to change notification settings - Fork 23
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: [DHIS2-16372] Delete Relationships #3520
feat: [DHIS2-16372] Delete Relationships #3520
Conversation
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.
@eirikhaugstulen, can you add a Cypress test for the delete relationship functionality? Thank you!
...s/WidgetsRelationship/common/RelationshipsWidget/DeleteRelationship/useDeleteRelationship.js
Outdated
Show resolved
Hide resolved
...ents/WidgetsRelationship/common/RelationshipsWidget/DeleteRelationship/DeleteRelationship.js
Show resolved
Hide resolved
Hey @simonadomnisoru! |
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.
Added a reminder to look into before merging, other than that it looks great! 🎉
cy.wait('@deleteRelationship') | ||
.its('request.body') | ||
.should('deep.equal', { | ||
relationships: [{ relationship: 'mwswG3RMNuu' }], |
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.
Reminder after the bug in the API is fixed: To keep DB consistency, the relationship that was deleted should be added back. Otherwise, the there is an existing relationship
step will fail the next time the scenario is run.
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.
This data is actually just mocked, so no need to add it again. We intercept the request for relationships in the before hook and then assert that we send the actual call to the api with the correct data! WDYT?
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.
Testing against mocked data versus the API and DB has advantages and disadvantages 🤔 . By using mock data, we will no longer benefit from having the latest API changes available. We will need to ensure that the mocks are always up to date, otherwise, we may not detect when we introduce bugs.
Let's discuss it more in-depth in our next FE check-in meeting!
🚀 Deployed on https://deploy-preview-3520--dhis2-capture.netlify.app |
…_DeleteTEIRelationships
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.
Tested successfully on 2.41,2.40.3,2.39.5,2.38.7 versions
…_DeleteTEIRelationships # Conflicts: # i18n/en.pot
…_DeleteTEIRelationships # Conflicts: # i18n/en.pot
# [100.58.0](v100.57.6...v100.58.0) (2024-03-03) ### Features * [DHIS2-16372] Delete Relationships ([#3520](#3520)) ([9fed562](9fed562))
🎉 This PR is included in version 100.58.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Tech-summary:
Some caveats:
tracker-agile-team