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

RUN-2353-Refactor editProject test to improve readability and maintainability #9115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jayas006
Copy link
Contributor

@jayas006 jayas006 commented May 8, 2024

Is this a bugfix, or an enhancement? Please describe.
This is an enhancement of the testing suite for the EditProjectFile.vue component.

Describe the solution you've implemented
I've refactored the tests for EditProjectFile.vue to improve readability and maintainability. The changes include better organization of test cases, clearer descriptions, and removal of unnecessary global mocks.

Describe alternatives you've considered
An alternative would have been to leave the tests as they were, but this would have made the test suite harder to maintain and understand in the long run.

Additional context

Copy link
Contributor

@smartinellibenedetti smartinellibenedetti left a comment

Choose a reason for hiding this comment

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

there's still stuff to be cleaned up:
there are expects that are asserting exists,
there is an override of wrapper.vm.fileText that should be removed
there is a test that isn't using the spy anymore (or that didn't get added before)

Also, you shouldn't have the template hardcoding that string inside the span - you can change the template to render the content of the getValue method (you don't need to add a new var inside data for this)

@jayas006
Copy link
Contributor Author

jayas006 commented May 9, 2024

there's still stuff to be cleaned up: there are expects that are asserting exists, there is an override of wrapper.vm.fileText that should be removed there is a test that isn't using the spy anymore (or that didn't get added before)

Also, you shouldn't have the template hardcoding that string inside the span - you can change the template to render the content of the getValue method (you don't need to add a new var inside data for this)

I have tried to fix according to the review pointers. Please let me know if there are any further changes required or if any aspect of the test needs to be updated.

Copy link
Contributor

@mrdubr mrdubr left a comment

Choose a reason for hiding this comment

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

LGTM

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

3 participants