-
Notifications
You must be signed in to change notification settings - Fork 156
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] Add/refactor unit tests for views #7945
Conversation
562b317
to
7d0f29a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🥳 🎉 🥳 🎉
sideBarActivePanel: ref(''), | ||
...options | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖 💖 💖 💖 💖 💖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smart 🤓
currentRoute: { name: 'files-common-favorites' } | ||
}), | ||
$client: { | ||
publicFiles: { list: jest.fn(() => Promise.resolve([{ getProperty: jest.fn() }])) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe beyond the scope of this PR, but can't we use the client/clientService mock here?
Possibly even worth porting to web-client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
$uppyService: mockDeep<UppyService>(), | ||
...(gettext && { | ||
$gettextInterpolate: jest.fn(), | ||
$ngettext: jest.fn(), | ||
$pgettext: jest.fn(), | ||
$gettext: jest.fn() | ||
$gettext: jest.fn((text) => text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
perPage: 10 | ||
} | ||
}) | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
$client: mockDeep<OwnCloudSdk>(), | ||
$client: mockDeep<OwnCloudSdk>({ | ||
publicFiles: { list: jest.fn(() => Promise.resolve([{ getProperty: jest.fn() }])) } | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I guess 😅
41b925f
to
305468a
Compare
305468a
to
807585f
Compare
items: ComputedRef<Array<T>> | ||
sortBy: ComputedRef<string> | ||
sortDir: ComputedRef<SortDir> | ||
items: MaybeRef<Array<T>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woah dude! ❤️
sideBarActivePanel: ref(''), | ||
...options | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smart 🤓
Description
Added/refactored unit tests for the following views:
GenericSpace
GenericTrash
SharedWithMe
SharedWithOthers
SharedViaLink
Projects
DriveResolver
Favorites
FilesDrop
Related Issue
Types of changes