Skip to content

Commit

Permalink
feat: always show share type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Nov 22, 2023
1 parent e1e5998 commit 31121ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/web-app-files/src/views/shares/SharedWithMe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
@toggle-filter="setAreHiddenFilesShown"
/>
<item-filter
v-if="shareTypes.length > 1"
:allow-multiple="true"
:filter-label="$gettext('Share Type')"
:filterable-attributes="['label']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,21 @@ describe('SharedWithMe view', () => {
})
})
describe('share type', () => {
it('shows filter if more than one share types are present', () => {
it('shows all available share types as filter option', () => {
const shareType1 = ShareTypes.user
const shareType2 = ShareTypes.group
const { wrapper } = getMountedWrapper({
files: [
mock<Resource>({ share: { shareType: ShareTypes.user.value } }),
mock<Resource>({ share: { shareType: ShareTypes.group.value } })
mock<Resource>({ share: { shareType: shareType1.value } }),
mock<Resource>({ share: { shareType: shareType2.value } })
]
})
const filterItems = wrapper.findComponent<any>('.share-type-filter').props('items')
expect(wrapper.find('.share-type-filter').exists()).toBeTruthy()
})
it('does not show filter if only one share type is present', () => {
const { wrapper } = getMountedWrapper({
files: [mock<Resource>({ share: { shareType: ShareTypes.user.value } })]
})
expect(wrapper.find('.share-type-filter').exists()).toBeFalsy()
expect(filterItems).toEqual([
{ label: shareType1.label, key: shareType1.key },
{ label: shareType2.label, key: shareType2.key }
])
})
})
describe('shared by', () => {
Expand Down

0 comments on commit 31121ab

Please sign in to comment.