Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Nov 16, 2021
1 parent 0846a70 commit 96103b5
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 76 deletions.
2 changes: 1 addition & 1 deletion packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</oc-drop>
</template>
<size-info v-if="hasBulkActions && selectedFiles.length > 0" class="oc-mr uk-visible@l" />
<batch-actions v-if="hasBulkActions && selectedFiles.length > 0" />
<batch-actions v-if="hasBulkActions" />
</div>
<view-options />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('AppBar component', () => {
const route = {
name: page,
params: {
// what's going on here?
// item is the link token for public links (root of the public link) vs. empty for personal page (root of the home)
item: page === 'files-public-list' ? '6mfXfTtYHVxrlAu' : ''
},
meta: {
Expand Down Expand Up @@ -217,11 +217,11 @@ describe('AppBar component', () => {

describe('when no items are selected', () => {
it('should show batch actions but not size-info', () => {
// const batchActions = wrapper.find(elSelector.batchActions) // TODO: Fix this one
const batchActions = wrapper.find(elSelector.batchActions)
const sizeInfo = wrapper.find(elSelector.sizeInfo)

expect(sizeInfo.exists()).toBeFalsy()
// expect(batchActions.isVisible()).toBeTruthy() // TODO: Fix this one
expect(batchActions.isVisible()).toBeTruthy()
})
})

Expand Down Expand Up @@ -265,12 +265,13 @@ describe('AppBar component', () => {
expect(newButton.exists()).toBeFalsy()
expect(ocDrop.exists()).toBeFalsy()
})
it('should not show batch actions and size-info', () => {
const batchActions = wrapper.find(elSelector.batchActions)
it('should not show size-info', () => {
const sizeInfo = wrapper.find(elSelector.sizeInfo)

expect(sizeInfo.exists()).toBeFalsy()
expect(batchActions.exists()).toBeFalsy()
})
it('should show batch actions', () => {
const batchActions = wrapper.find(elSelector.batchActions)
expect(batchActions.exists()).toBeTruthy()
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,21 @@ function getWrapper(route, { filename, extension, type = '', mimeType }, availab
publicPage: () => false
},
propsData: {
item: {
id: 'a93f8adf==',
fileId: 'a93f8adf==',
name: filename,
path: type === 'file' ? `/${filename}.${extension}` : `/${filename}`,
mimeType,
extension,
type,
canDownload: () => true,
isReceivedShare: () => true,
canBeDeleted: () => true,
canRename: () => true
}
items: [
{
id: 'a93f8adf==',
fileId: 'a93f8adf==',
name: filename,
path: type === 'file' ? `/${filename}.${extension}` : `/${filename}`,
mimeType,
extension,
type,
canDownload: () => true,
isReceivedShare: () => true,
canBeDeleted: () => true,
canRename: () => true
}
]
},
computed: {
menuSections: () => mockMenuSections
Expand Down
Loading

0 comments on commit 96103b5

Please sign in to comment.