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

Unit test linking and unlinking attributions #2039

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

MarkusObendrauf
Copy link
Contributor

@MarkusObendrauf MarkusObendrauf commented Sep 25, 2023

Summary of changes

Unit test linking and unlinking resources.
Also, improve the test for deleting resources, which currently doesn't assert any changes between the output and input childrenFromAttributedResources.

Context and reason for change

I plan to change these functions soon as part of #2030, so having unit tests is nice.

How can the changes be tested

yarn jest src/Frontend/state/helpers/__tests__/save-action-helpers.test.ts

@MarkusObendrauf MarkusObendrauf marked this pull request as ready for review September 25, 2023 08:21
Copy link
Contributor

@davidmundelius davidmundelius left a comment

Choose a reason for hiding this comment

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

Aside from the one point I mentioned above, this looks good to me.

});
});

it('correctly maintains childrenFromAttributedResources', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this item test anything which is not covered by the previous one? It seems that the only difference between the two is that the first one contains more expect statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. now that im looking at it, theres really no need to have two tests for linking or for unlinking. and i should revert my changes to the deletion test, since i only made it match the first test.

Signed-off-by: Markus Obendrauf <markusobendrauf@fb.com>
Copy link
Contributor

@davidmundelius davidmundelius left a comment

Choose a reason for hiding this comment

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

Looks good to me now.

@MarkusObendrauf MarkusObendrauf merged commit 0eb3b49 into opossum-tool:main Sep 25, 2023
@MarkusObendrauf MarkusObendrauf deleted the test-link-unlink branch September 25, 2023 13:54
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