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

[tests-only] mock router-link in Trashbin unit tests #6421

Conversation

individual-it
Copy link
Member

Description

mock the router-link element un Trashbin unit tests

Related Issue

YES ITS THE LAST ONE! I get a nice clean run locally now:

artur@deepthought3:~/www/owncloud-web$ yarn run test:unit
 PASS  packages/web-app-files/tests/unit/views/spaces/Projects.spec.js (13.722 s)
 PASS  packages/web-app-files/tests/unit/views/Favorites.spec.js (14.042 s)
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/PublicLinks/LinkEdit.spec.js (14.78 s)
 PASS  packages/web-app-files/tests/unit/components/AppBar/AppBar.spec.js (14.597 s)
 PASS  packages/web-app-files/tests/unit/views/PublicFiles.spec.ts (14.77 s)
 PASS  packages/web-app-files/tests/unit/views/SharedViaLink.spec.js (15.276 s)
 PASS  packages/web-app-files/tests/unit/views/SharedWithMe.spec.js
 PASS  packages/web-app-files/tests/unit/search/sdk.spec.ts
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.js
 PASS  packages/web-app-files/tests/unit/views/Trashbin.spec.js
 PASS  packages/web-app-files/tests/unit/views/SharedWithOthers.spec.js
 PASS  packages/web-app-files/tests/unit/components/FilesList/ContextActions.spec.js
 PASS  packages/web-app-files/tests/unit/views/LocationPicker.spec.js
 PASS  packages/web-app-files/tests/unit/components/FilesList/ResourceTable.spec.js (17.755 s)
 PASS  packages/web-app-search/tests/unit/portals/SearchBar.spec.ts
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/InviteCollaborator/ExpirationDatepicker.spec.ts
 PASS  packages/web-runtime/tests/unit/components/Topbar/FeedbackLink.spec.js
 PASS  packages/web-app-files/tests/unit/views/Personal.spec.js
 PASS  packages/web-app-files/tests/unit/views/spaces/Project.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/RoleDropdown.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/FileLinks.spec.js
 PASS  packages/web-app-files/tests/unit/components/Search/List.spec.js
 PASS  packages/web-app-files/tests/unit/views/PublicLink.spec.js
 PASS  packages/web-runtime/tests/unit/container/bootstrap.spec.ts
 PASS  packages/web-app-files/tests/unit/components/SideBar/Details/FileDetails.spec.js
 PASS  packages/web-app-files/tests/unit/views/FilesDrop.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/SideBar.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/Collaborators/ListItem.spec.js
 PASS  packages/web-app-files/tests/unit/components/Upload/ProgressBar.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/PublicLinks/LinkInfo.spec.js
 PASS  packages/web-runtime/tests/unit/components/Topbar/ThemeSwitcher.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Versions/FileVersions.spec.js
 PASS  packages/web-app-files/tests/unit/components/AppBar/ViewOptions.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Actions/FileActions.spec.js
 PASS  packages/web-app-files/tests/unit/components/Search/Preview.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/InviteCollaborator/AutocompleteItem.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/InviteCollaborator/RecipientContainer.spec.js
 PASS  packages/web-app-files/tests/unit/search/filter.spec.ts
 PASS  packages/web-runtime/tests/unit/store/config.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Details/FileDetailsMultiple.spec.js
 PASS  packages/web-pkg/tests/unit/composables/router/useRouteQuery.spec.ts
 PASS  packages/web-runtime/tests/unit/components/Topbar/UserMenu.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/share/triggerShareAction.spec.js
 PASS  packages/web-app-files/tests/unit/components/AppBar/Upload/FileUpload.spec.js
 PASS  packages/web-app-files/tests/unit/views/PrivateLink.spec.js
 PASS  packages/web-app-files/tests/unit/components/AppBar/Upload/FolderUpload.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/FileInfo.spec.js
 PASS  packages/web-app-files/tests/unit/composables/fileListHeaderPosition/useFileListHeaderPosition.spec.ts
 PASS  packages/web-pkg/tests/unit/composables/store/useStore.spec.ts
 PASS  packages/web-app-files/tests/unit/components/FilesList/NotFoundMessage.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/actions/rename.spec.js
 PASS  packages/web-runtime/tests/unit/components/Topbar/TopBar.spec.js
 PASS  packages/web-app-files/tests/unit/store/mutations.spec.js
 PASS  packages/web-app-files/tests/unit/components/Upload/DetailsWidget.spec.js
 PASS  packages/web-app-files/tests/unit/composables/pagination/usePagination.spec.ts
 PASS  packages/web-runtime/tests/unit/components/Topbar/Notification.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/share/role.spec.ts
 PASS  packages/web-pkg/tests/unit/composables/router/useRouter.spec.ts
 PASS  packages/web-pkg/tests/unit/composables/store/useMutationSubscription.spec.ts
 PASS  packages/web-app-files/tests/unit/components/AppBar/Upload/FileDrop.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/actions/acceptShare.spec.js
 PASS  packages/web-runtime/tests/unit/components/SidebarNav/SidebarNav.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/PublicLinks/ListItem.spec.js
 PASS  packages/web-runtime/tests/unit/helpers/theme.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/share/type.spec.ts
 PASS  packages/web-app-files/tests/unit/mixins.spec.js
 PASS  packages/web-app-files/tests/unit/composables/sort/useSort.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/share/permission.spec.ts
 PASS  packages/web-app-files/tests/unit/components/FilesList/ListInfo.spec.js
 PASS  packages/web-pkg/tests/unit/event/bus.spec.ts
 PASS  packages/web-runtime/tests/unit/components/Avatar.spec.js
 PASS  packages/web-app-files/tests/unit/store/getters.spec.js
 PASS  packages/web-app-files/tests/unit/components/FilesList/QuickActions.spec.js
 PASS  packages/web-app-files/tests/unit/components/ActionMenuItem.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/PublicLinks/LinkActions.spec.js
 PASS  packages/web-runtime/tests/unit/components/SidebarNav/SidebarNavItem.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/PrivateLinkItem.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Links/CopyToClipboardButton.spec.js
 PASS  packages/web-app-external/tests/unit/app.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/resource/sameResource.spec.ts
 PASS  packages/web-app-files/tests/unit/components/AppBar/SelectedResources/SizeInfo.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/spaces/rename.spec.js
 PASS  packages/web-app-files/tests/unit/components/FilesList/Pagination.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/actions/delete.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/deleteResources.spec.js
 PASS  packages/web-app-files/tests/unit/components/AppBar/SelectedResources/BatchActions.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts
 PASS  packages/web-pkg/tests/unit/http/client.spec.ts
 PASS  packages/web-app-files/tests/unit/router/utils.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/download/downloadAsArchive.spec.ts
 PASS  packages/web-app-files/tests/unit/components/FilesList/NoContentMessage.spec.js
 PASS  packages/web-runtime/tests/unit/components/SkipTo.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/resource/filter.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/resource/publicPreviewUrl.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/resource/privatePreviewBlob.spec.ts
 PASS  packages/web-runtime/tests/unit/components/Topbar/ApplicationsMenu.spec.js
 PASS  packages/web-runtime/tests/unit/mixins/lifecycleMixin.spec.js
 PASS  packages/web-app-files/tests/unit/services/cache.spec.ts
 PASS  packages/web-runtime/tests/unit/components/MessageBar.spec.js
 PASS  packages/web-app-files/tests/unit/services/archiver.spec.ts
 PASS  packages/web-pkg/tests/unit/observer/visibility.spec.ts
 PASS  packages/web-runtime/tests/unit/mixins/focusMixin.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/spaces/delete.spec.js
 PASS  packages/web-pkg/tests/unit/services/client.spec.ts
 PASS  packages/web-app-external/tests/unit/components/ErrorScreen.spec.ts
 PASS  packages/web-pkg/tests/unit/cache/cache.spec.ts
 PASS  packages/web-pkg/tests/unit/instance/index.spec.ts
 PASS  packages/web-app-search/tests/unit/views/List.spec.ts
 PASS  packages/web-runtime/tests/unit/container/versions.spec.ts
 PASS  packages/web-pkg/tests/unit/utils/objectKeys.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/statusIndicator.spec.js
 PASS  packages/web-app-search/tests/unit/store/options.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/store.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/path.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/ui/filesList.spec.ts
 PASS  packages/web-pkg/tests/unit/decorator/debounce.spec.ts
 PASS  packages/web-pkg/tests/unit/utils/encodePath.spec.ts
 PASS  packages/web-app-search/tests/unit/service/providerStore.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/resource/asset.spec.ts
 PASS  packages/web-app-files/tests/unit/helpers/permissions.spec.js
 PASS  packages/web-app-files/tests/unit/store/modules/sidebar.spec.js
 PASS  packages/web-app-files/tests/unit/mixins/resources.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/textUtils.spec.js
 PASS  packages/web-runtime/tests/unit/helpers/config.spec.js
 PASS  packages/web-app-files/tests/unit/components/SideBar/Shares/InviteCollaborator/InviteCollaboratorForm.spec.js
 PASS  packages/web-app-files/tests/unit/helpers/resource/common.spec.ts
 PASS  packages/web-app-external/tests/unit/components/LoadingScreen.spec.ts
 PASS  packages/web-runtime/tests/unit/helpers/resource.spec.js

Test Suites: 128 passed, 128 total
Tests:       34 todo, 832 passed, 866 total
Snapshots:   105 passed, 105 total
Time:        39.398 s
Ran all test suites.

Motivation and Context

get rid of error log outputs during test runs

  ● Console

    console.error
      [Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
      
      found in
      
      ---> <OcResource>
             <OcTableCell>
               <OcTd>
                 <OcTr>
                   <OcTbody>
                     <OcTable>
                       <ResourceTable>
                         <Anonymous>
                           <Root>

      at warn (node_modules/vue/dist/vue.runtime.common.dev.js:621:15)
      at createElm (node_modules/vue/dist/vue.runtime.common.dev.js:5962:11)
      at createChildren (node_modules/vue/dist/vue.runtime.common.dev.js:6077:9)
      at createElm (node_modules/vue/dist/vue.runtime.common.dev.js:5978:9)
      at createChildren (node_modules/vue/dist/vue.runtime.common.dev.js:6077:9)
      at createElm (node_modules/vue/dist/vue.runtime.common.dev.js:5978:9)
      at createChildren (node_modules/vue/dist/vue.runtime.common.dev.js:6077:9)
      at createElm (node_modules/vue/dist/vue.runtime.common.dev.js:5978:9)

How Has This Been Tested?

  • run unit tests locally
  • 🤖

Screenshots (if appropriate):

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:

Open tasks:

  • ...

@sonarcloud
Copy link

sonarcloud bot commented Feb 11, 2022

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

@individual-it
Copy link
Member Author

CI run also nice and clean
logs_owncloud_web_22682_9_7.log

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.

BÄÄM!

@pascalwengerter pascalwengerter merged commit 7a55ccd into master Feb 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the reduceLogOutput/web-app-files/tests/unit/views/Trashbin.spec.js branch February 11, 2022 10:39
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.

Lots of warnings & errors when running unit tests
2 participants