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

SLVS-1718 Fix UI not updated after deleting connection #5906

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

gabriela-trutan-sonarsource
Copy link
Contributor

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource commented Dec 18, 2024

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title SLVS-1718 Fix UI not updated after deleting connection SLVS-1718 Fix UI not updated after deleting connection Dec 18, 2024
Copy link
Contributor

@vnaskos-sonar vnaskos-sonar left a comment

Choose a reason for hiding this comment

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

Check first the comment about calling the DisplayBindStatusAsync instead of the AfterUnbind on the UnbindAsync 😉

[TestMethod]
public async Task DisplayBindStatusAsync_WhenProjectWasBoundAndBecomesUnbound_UpdatesCurrentProjectAndBindingInfoToNull()
{
await InitializeBoundProject();
Copy link
Contributor

Choose a reason for hiding this comment

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

Practically the InitializeBoundProject is doing nothing in this test, so as the WasBound part on the name.

This test can be merged with the one above (DisplayBindStatusAsync_WhenProjectIsNotBound_SelectedConnectionShouldBeEmpty) as they are testing the same things, and renamed to something like DisplayBindStatusAsync_WhenProjectIsNotBound_ClearsBinding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The two tests are not identical:
The InitializeBoundProject does something very important: initializes the view model propeties (SelectedConnectionInfo, SelectedProject, BoundProject) with objects whereas the other test sets them to null.

I will keep the test DisplayBindStatusAsync_WhenProjectIsNotBound_SelectedConnectionShouldBeEmpty, because it is a regression test, i.e. it will make sure that when we have a bound project and then unbind, the properties in the view model are set to null

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the await InitializeBoundProject(); has the same result, the test passes. The InitializeBoundProject is irrelevant in this case.

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