This repository was archived by the owner on Nov 23, 2026. It is now read-only.
Repository navigation
[tests-only] Add/refactor unit tests for views - #7945
Merged
Merged
Conversation
JammingBen
force-pushed
the
view-unit-tests
branch
from
November 10, 2022 12:44
562b317 to
7d0f29a
Compare
JammingBen
marked this pull request as ready for review
November 11, 2022 14:09
dschmidt
approved these changes
Nov 11, 2022
| sideBarActivePanel: ref(''), | ||
| ...options | ||
| } | ||
| } |
| currentRoute: { name: 'files-common-favorites' } | ||
| }), | ||
| $client: { | ||
| publicFiles: { list: jest.fn(() => Promise.resolve([{ getProperty: jest.fn() }])) } |
Member
There was a problem hiding this comment.
Maybe beyond the scope of this PR, but can't we use the client/clientService mock here?
Possibly even worth porting to web-client
Contributor
Author
There was a problem hiding this comment.
I added it to the deep mock in defaultComponentMocks for now 👍
Edit: Nvm, moved it back to the tests as discussed. Makes more sense to be there.
| $ngettext: jest.fn(), | ||
| $pgettext: jest.fn(), | ||
| $gettext: jest.fn() | ||
| $gettext: jest.fn((text) => text) |
| perPage: 10 | ||
| } | ||
| }) | ||
| })) |
dschmidt
reviewed
Nov 11, 2022
| $client: mockDeep<OwnCloudSdk>(), | ||
| $client: mockDeep<OwnCloudSdk>({ | ||
| publicFiles: { list: jest.fn(() => Promise.resolve([{ getProperty: jest.fn() }])) } | ||
| }), |
JammingBen
force-pushed
the
view-unit-tests
branch
from
November 11, 2022 14:41
41b925f to
305468a
Compare
JammingBen
force-pushed
the
view-unit-tests
branch
from
November 11, 2022 14:43
305468a to
807585f
Compare
dschmidt
approved these changes
Nov 11, 2022
dschmidt
reviewed
Nov 11, 2022
| items: ComputedRef<Array<T>> | ||
| sortBy: ComputedRef<string> | ||
| sortDir: ComputedRef<SortDir> | ||
| items: MaybeRef<Array<T>> |
Member
There was a problem hiding this comment.
Note: this is a MaybeRef instead of a ReadOnlyRef because we use a Partial of this type as argument to a Mock Factory and it makes passing along the value easier
|
Kudos, SonarCloud Quality Gate passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description
Added/refactored unit tests for the following views:
GenericSpaceGenericTrashSharedWithMeSharedWithOthersSharedViaLinkProjectsDriveResolverFavoritesFilesDropRelated Issue
Types of changes