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-tests-only] Add unit tests for SharedViaLink view #5778

Merged
merged 3 commits into from
Dec 20, 2021

Conversation

saw-jan
Copy link
Member

@saw-jan saw-jan commented Sep 6, 2021

Description

Added unit tests for SharedViaLink view

Related Issue

Motivation and Context

increase unit test coverage

How Has This Been Tested?

  • test environment: local

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

package.json Outdated
@@ -77,6 +77,7 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.13.0",
"eslint-plugin-vuejs-accessibility": "^0.7.1",
"flush-promises": "^1.0.2",
Copy link
Member Author

@saw-jan saw-jan Sep 6, 2021

Choose a reason for hiding this comment

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

This package helps to flush all promises which means that we don't need to use wrapper.vm.$nextTick() twice or more in order to wait for all promises to get resolved.
https://vue-test-utils.vuejs.org/guides/#testing-asynchronous-behavior

Should we use it?

Copy link
Contributor

@kiranparajuli589 kiranparajuli589 Sep 6, 2021

Choose a reason for hiding this comment

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

@dpakach does this helps for the test you're writing for autocomplete inputs taking some time to trigger. If such problems with static waits or of course multiple nextTick can be resolved...imo this might be useful

Copy link
Contributor

Choose a reason for hiding this comment

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

sadly doesn't works in my case

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR needs a rebase and I'm not sure why there was an attempt to use promises so heavily here that it needs an additional library to work around it. Trying a different approach, I'll ping you once I know if it works;)

Copy link
Member Author

Choose a reason for hiding this comment

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

@pascalwengerter, @kiranparajuli589 has made an update to this PR. Please review.

@saw-jan saw-jan mentioned this pull request Sep 6, 2021
11 tasks
@saw-jan saw-jan force-pushed the sharedViaLink-view-tests branch 2 times, most recently from bbff3af to 8ab03d7 Compare September 15, 2021 11:29
Copy link
Contributor

@kiranparajuli589 kiranparajuli589 left a comment

Choose a reason for hiding this comment

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

lgtm 👍🏼

@saw-jan saw-jan force-pushed the sharedViaLink-view-tests branch 2 times, most recently from f78e678 to da1cfd9 Compare September 28, 2021 10:33
@saw-jan saw-jan force-pushed the sharedViaLink-view-tests branch 5 times, most recently from 296f502 to ee432a6 Compare October 28, 2021 08:52
@individual-it
Copy link
Member

blocked waiting for review @kulmann @pascalwengerter

saw-jan and others added 3 commits December 20, 2021 12:06
add flush-promises package

add unit tests for SharedViaLink view

add unit tests for SharedViaLink view

address reviews

update tests after component changes
@sonarcloud
Copy link

sonarcloud bot commented Dec 20, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

LGTM, I think we can take a look into adding better tests for the Files App Views but this is a good start 🥅

@pascalwengerter pascalwengerter merged commit 7647b32 into master Dec 20, 2021
@phil-davis phil-davis deleted the sharedViaLink-view-tests branch December 20, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants