Skip to content

Commit

Permalink
tests: add hidden files to all fixtures and increase page limit
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Jun 29, 2021
1 parent d034d21 commit 21843d3
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 5 deletions.
11 changes: 11 additions & 0 deletions __fixtures__/deletedFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ export default [
},
tusSupport: null
},
{
name: '/trash-bin/alice/3875',
type: 'dir',
fileInfo: {
'{http://owncloud.org/ns}trashbin-original-filename': '.hidden-folder',
'{http://owncloud.org/ns}trashbin-original-location': '.hidden-folder',
'{http://owncloud.org/ns}trashbin-delete-datetime': 'Mon, 14 Jun 2021 12:15:33 GMT',
'{DAV:}resourcetype': ['{DAV:}collection']
},
tusSupport: null
},
{
name: '/trash-bin/alice/3873',
type: 'dir',
Expand Down
18 changes: 18 additions & 0 deletions __fixtures__/favoriteFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ export default [
},
tusSupport: null
},
{
name: '/.hidden folder',
type: 'dir',
fileInfo: {
'{http://owncloud.org/ns}permissions': 'RDNVCK',
'{http://owncloud.org/ns}favorite': '1',
'{http://owncloud.org/ns}fileid': '14',
'{http://owncloud.org/ns}owner-id': 'admin',
'{http://owncloud.org/ns}owner-display-name': 'admin',
'{http://owncloud.org/ns}share-types': '',
'{http://owncloud.org/ns}privatelink': 'http://localhost:8080/f/14',
'{http://owncloud.org/ns}size': '0',
'{DAV:}getlastmodified': 'Thu, 24 Jun 2021 15:03:58 GMT',
'{DAV:}getetag': '"60d49edf01ab8"',
'{DAV:}resourcetype': ['{DAV:}collection']
},
tusSupport: null
},
{
name: '/Photos',
type: 'dir',
Expand Down
14 changes: 14 additions & 0 deletions __fixtures__/publicFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ export default {
return this.fileInfo[prop]
}
},
{
name: '/link/.hidden-folder',
type: 'dir',
fileInfo: {
'{http://owncloud.org/ns}permissions': '',
'{http://owncloud.org/ns}fileid': '3834',
'{http://owncloud.org/ns}owner-id': 'admin',
'{http://owncloud.org/ns}owner-display-name': 'admin',
'{http://owncloud.org/ns}size': '0',
'{DAV:}getlastmodified': 'Mon, 14 Jun 2021 12:59:12 GMT',
'{DAV:}resourcetype': ['{DAV:}collection']
},
tusSupport: null
},
{
name: '/link/Documents',
type: 'dir',
Expand Down
35 changes: 35 additions & 0 deletions __fixtures__/sharedFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ const files = {
}
]
},
{
id: '64',
share_type: 3,
uid_owner: 'admin',
displayname_owner: 'admin',
permissions: 1,
stime: 1623242657,
parent: null,
expiration: null,
token: 'sADy5cUdrz931MV',
uid_file_owner: 'admin',
displayname_file_owner: 'admin',
additional_info_owner: null,
additional_info_file_owner: null,
path: '/.hidden-folder',
mimetype: 'httpd/unix-directory',
storage_id: 'home::admin',
storage: 2,
item_type: 'folder',
item_source: 3010,
file_source: 3010,
file_parent: 6,
file_target: '/.hidden-folder',
name: 'Quick action link',
url: 'http://host.docker.internal:8080/s/sADy5cUdrz931MV',
mail_send: 0,
attributes: null,
tags: [],
sharedWith: [
{
name: 'Quick action link',
link: true
}
]
},
{
id: '39',
share_type: 3,
Expand Down
35 changes: 35 additions & 0 deletions __fixtures__/sharedViaLinkFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ const files = {
}
]
},
{
id: '57',
share_type: 3,
uid_owner: 'admin',
displayname_owner: 'admin',
permissions: 1,
stime: 1623242657,
parent: null,
expiration: null,
token: 'sADy5cUdrz931MV',
uid_file_owner: 'admin',
displayname_file_owner: 'admin',
additional_info_owner: null,
additional_info_file_owner: null,
path: '/.hidden-folder',
mimetype: 'httpd/unix-directory',
storage_id: 'home::admin',
storage: 2,
item_type: 'folder',
item_source: 3009,
file_source: 3009,
file_parent: 6,
file_target: '/.hidden-folder',
name: 'Quick action link',
url: 'http://host.docker.internal:8080/s/sADy5cUdrz931MV',
mail_send: 0,
attributes: null,
tags: [],
sharedWith: [
{
name: 'Quick action link',
link: true
}
]
},
{
id: '39',
share_type: 3,
Expand Down
31 changes: 31 additions & 0 deletions __fixtures__/sharedWithMeFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,37 @@ const files = {
attributes: null,
tags: []
},
{
id: '33',
share_type: 0,
uid_owner: 'bob',
displayname_owner: 'bob',
permissions: 17,
stime: 1620810871,
parent: null,
expiration: null,
token: null,
uid_file_owner: 'bob',
displayname_file_owner: 'bob',
additional_info_owner: null,
additional_info_file_owner: null,
state: 2,
path: '/.hidden-folder',
mimetype: 'httpd/unix-directory',
storage_id: 'home::bob',
storage: 33,
item_type: 'folder',
item_source: 2243,
file_source: 2243,
file_parent: 1322,
file_target: '/.hidden-folder',
share_with: 'admin',
share_with_displayname: 'admin',
share_with_additional_info: null,
mail_send: 0,
attributes: null,
tags: []
},
{
id: '23',
share_type: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, waitFor, fireEvent } from '@testing-library/vue'

import toKebabCase from '../../../../../tests/helpers/toKebabCase'

import StoreFiles from '../../../src/store'
import StoreFiles from '@files/src/store'
import Store from '@runtime/src/store'

import Personal from '../../../src/views/Personal.vue'
Expand Down Expand Up @@ -62,7 +62,7 @@ const store = {
...StoreFiles,
state: {
...StoreFiles.state,
filesPageLimit: 1
filesPageLimit: 2
}
}
}
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('User can navigate in files list using pagination', () => {
expect(document.querySelector('.oc-pagination')).toBeVisible()

// 2 links, 1 current page and 1 next page link
expect(document.querySelectorAll('.oc-pagination-list-item').length).toBe(4)
expect(document.querySelectorAll('.oc-pagination-list-item').length).toBe(3)

const secondPage = document
.evaluate(
Expand Down Expand Up @@ -175,9 +175,9 @@ describe('User can navigate in files list using pagination', () => {

expect(queryByText('Documents')).toBe(null)
expect(getByText('Photos')).toBeVisible()
expect(queryByText('ownCloud Manual')).toBe(null)
expect(queryByText('ownCloud Manual')).toBeVisible()
expect(document.querySelector('.oc-pagination')).toBeVisible()
expect(document.querySelectorAll('.oc-pagination-list-item').length).toBe(5)
expect(document.querySelectorAll('.oc-pagination-list-item').length).toBe(3)
expect(document.querySelector('.oc-pagination-list-item-current').textContent).toMatch('2')
}
)
Expand Down

0 comments on commit 21843d3

Please sign in to comment.