aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix move related testsTomasz Grobelny2018-11-031-54/+63
| | | | Signed-off-by: Tomasz Grobelny <tomasz@grobelny.net>
* Use grid view in other file views tooJan-Christoph Borchardt2018-10-184-4/+4
| | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Tests: Properly compare the file action labelJulius Härtl2018-10-151-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Make activity events strictJoas Schilling2018-10-121-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix usage of deprecated OC.webrootChristoph Wurst2018-10-095-37/+37
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fixes empty favorite names for trailing slashesMichael Weimann2018-09-191-3/+69
| | | | Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
* Improves the testsMichael Weimann2018-08-171-9/+24
| | | | Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
* Adds a test to check that the sorting isn't stored without an userMichael Weimann2018-08-171-0/+16
| | | | Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
* Merge pull request #10310 from nextcloud/accessibility-headerMorris Jobke2018-07-251-11/+11
|\ | | | | Accessibility fixes for header and global elements
| * Fix ability to open file or folder via keyboard, fix #10008Jan-Christoph Borchardt2018-07-241-11/+11
| | | | | | | | | | | | | | | | | | | | | | Before, the file or folder was opened when clicking on the name span, but not when clicking on the link that contains the name; clicking on the link highlighted the file and opened the sidebar, just like clicking on the file size or date. Now clicking on the link opens the file or folder, so the unit tests that tested clicks on the link were changed to test clicking on the file size instead. Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* | Phpunit tests fixesJohn Molakvoæ (skjnldsv)2018-07-241-0/+63
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Jsunit fixes 1John Molakvoæ (skjnldsv)2018-07-202-2/+5
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Fixed phpunitJohn Molakvoæ (skjnldsv)2018-07-131-72/+12
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* No draggable list anymoreRoeland Jago Douma2018-07-121-1/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-07-121-3/+20
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fixed testsJohn Molakvoæ (skjnldsv)2018-07-121-12/+12
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix testsRoeland Jago Douma2018-07-051-0/+15
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Adds a test case for the loading symbol in deleted files.Abijeet2018-06-181-1/+1
| | | | Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Fixed failing test cases for the new actions menu.Abijeet2018-06-181-18/+44
| | | | Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Merge pull request #9029 from nextcloud/settings-restructureMorris Jobke2018-05-071-1/+1
|\ | | | | Restructure server settings
| * Fix settings testsJulius Härtl2018-05-031-1/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix jsunit testsJulius Härtl2018-05-071-1/+1
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Show the new dav url in the web UIRoeland Jago Douma2018-04-051-0/+1
| | | | | | Fixes #8795 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fixed jsunitJohn Molakvoæ (skjnldsv)2018-03-081-1/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #8588 from nextcloud/fix-breadcrumbs-width-calculationRoeland Jago Douma2018-03-011-21/+381
|\ | | | | Fix breadcrumbs width calculation
| * Update comments in testsDaniel Calviño Sánchez2018-02-281-3/+4
| | | | | | | | | | | | | | Menu and home are not always visible; home is always visible, but menu is shown only when needed. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Fix menu visibilityDaniel Calviño Sánchez2018-02-281-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crumb for the menu was shown like any other crumb when calling "_showCrumb", but it was also shown when other crumbs were hidden without taking into account the available width. This caused several related problems, like the breadcrumbs taking too much space when the menu was sometimes shown after the rest of the crumbs were adjusted to the available width, or the menu being shown instead of the last crumb even if there was room for it when the available width was increased. Now the menu is always hidden before starting the resizing of the crumbs to ensure that whether it was previously shown or not does not affect the result. In a similar way, the menu will no longer be shown by "_showCrumb", as it is not a regular crumb that has to be shown simply if there is enough room. The menu is now shown as soon as any other crumb is hidden; this ensures that the menu width will be taken into account in further width checks. As when _updateMenu" is called it no longer needs to take care of showing the menu this fixes the issue revealed when fixing the test setup in the previous commit. Finally, this implicitly fixes the failure in the breadcrumbs tests when run on Firefox, as it was caused by the menu interfering in the calculations of the other crumbs when increasing the width. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Fix setup to test the breadcrumbs menuDaniel Calviño Sánchez2018-02-281-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Shows only items not in the breadcrumb" test was failing when run on Firefox, but not on PhantomJS. This was caused by the differences in the starting width between both browsers and an incorrect setup of the test (the width set for the crumbs was overriden when the breadcrumbs were rendered again, and the breadcrumb was resized to 300 from an indeterminate initial width). Now the crumbs are rendered and then its width, padding and margin are set to a known value. Then it is resized to 1000px, which ensures that there will be enough room for all the crumbs and thus the menu will be hidden, and finally it is resized to 300, which causes the middle crumb to be hidden and the menu to be shown. Note, however, that the test now always fails, no matter if it is run on PhantomJS or on Firefox; if the menu crumb is hidden when "_updateMenu" is called it will show it, but it will also wrongly try to add the menu itself to the menu. As the "crumb-id" of the menu crumb is "-1" this causes the last regular crumb to be added to the menu. This will be fixed with other related issues in the next commit. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Take padding and margins of crumbs into accountDaniel Calviño Sánchez2018-02-281-0/+54
| | | | | | | | | | | | | | | | | | When calculating the total width of the crumbs only its padding was taken into account; now the margin is too. In a similar way, before showing a crumb only its width was taken into account; now its padding and margin are taken into account too. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Use hard-coded values for paddings and marginsDaniel Calviño Sánchez2018-02-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | This ensures that the resize tests do not depend on the values set in the CSS files. Note that this change causes a test to fail with Firefox, but not with PhantomJS. This is due to a difference in the starting width used by Firefox and by PhantomJS, and it will be fixed in a following commit. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Compress siblings before calculating the available width for crumbsDaniel Calviño Sánchez2018-02-281-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the parent element of the breadcrumbs was resized to a larger width and the siblings of the breadcrumbs expanded to fill all the available width some crumbs could be hidden even if there was enough room for them. The reason was that the width of the siblings being used to calculate the available width for the breadcrumbs was the expanded width of the siblings. Now as many crumbs as possible (that is, fitting in the parent, no matter the siblings) are first shown so the expanding siblings are compressed before calculating the available width. Due to the lack of support for flexboxes in PhantomJS the related unit test is skipped; it has to be run in other browser, like Firefox. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Take all visible siblings into accountDaniel Calviño Sánchez2018-02-281-4/+50
| | | | | | | | | | | | | | | | | | Other apps could add elements to the controls outside the creatable actions div (for example, the button to switch to the gallery), so the widths of all the visible siblings of the breadcrumbs have to be taken into account in the size calculations. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Take padding and margin of the creatable actions div into accountDaniel Calviño Sánchez2018-02-281-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some differences in width handling between the browsers used to run the tests, most likely due to their support (or lack of) of certain CSS features: PhantomJS requires "width" to be set (probably because it does not handle flex displays and treats it like a block, so "min-width" does not matter in this case), while Firefox requires "min-width" to be set (otherwise the children of "#controls" could be compressed due to its use of flex display and the elements would end with a different width than the one needed for the tests). Due to all that the width of the breadcrumb siblings must be specified in the tests using both "width" and "min-width". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Do not render the breadcrumbs again in resize testsDaniel Calviño Sánchez2018-02-281-3/+0
| | | | | | | | | | | | | | | | There is no need to call "setDirectory" again in resize tests; it is enough to simply resize them (and isolates them better to just test the resizing behaviour). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Set the width of the parent element in breadcrumb testsDaniel Calviño Sánchez2018-02-281-8/+13
| | | | | | | | | | | | | | | | | | Setting the width of the parent element of the breadcrumbs and then explicitly calling "_resize" is enough to test the resizing behaviour. This makes possible to remove the "setMaxWidth" method and its related code, which was used only for testing purposes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Fix unit testJoas Schilling2018-02-281-0/+6
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Split move and copy operationsRoland Tapken2018-02-152-1/+11
| | | | | | | | | | | | | | | The new 'Move and copy' operation from #6040 requires UPDATE permissions on the selected files. However, READ would be sufficient to create a copy of a file (if not viewed as a public share). For this reason this patch: - changes the permission of the 'MoveCopy' action to PERMISSION_READ - changes the label of the action depending on the permissions - changes the available buttons in the Move/Copy dialog depending on the permissions. The same changes are done to the filelist view for bulk actions. Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
* Fix empty details view after renaming a fileDaniel Calviño Sánchez2018-01-111-0/+30
| | | | | | | | | | | "FileList._updateDetailsView" expects either a file name (as a string) or a file model (as an "OCA.File.FileInfoModel"), but when called through "updateInList" an "OC.Files.FileInfo" object was given instead. As the given attribute was not a model "_updateDetailsView" treated it as a file name and tried to get the model for that file, which failed and caused the details view to be emptied. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Move adding test files to "beforeEach()"Daniel Calviño Sánchez2018-01-111-13/+6
| | | | | | | | | | | | All the tests in the "Renaming files" section added the test files, although those calling "doRename()" added them by setting a path for the file too. However, the path is ignored in the other tests, so adding the files can be unified and moved to "beforeEach()". This would be needed, for example, to show the details view for a file before calling "doRename()". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add events for favoritesJoas Schilling2018-01-101-1/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Hide favourite icon in details view if favourite action is not availableDaniel Calviño Sánchez2018-01-051-0/+29
| | | | | | | | | | | | When the favourite icon in the details view is clicked the "Favorite" action is triggered. However, if the action name given to "triggerAction" is not found then the "Download" action is triggered instead. As the "Favorite" action is not available in some file lists (like "Recents") the "Download" action was executed instead in those cases, which was a strange behaviour. Now the favourite icon is hidden if its action is not available. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix "fileActions.currentFile" not set before using itDaniel Calviño Sánchez2017-12-261-0/+24
| | | | | | | | | | | When an empty area of a file row was clicked and the "Details" action was executed "fileActions.currentFile" was not guaranteed to be set to the appropriate object (it depended on the previous actions of the user), so when it was used by "getCurrentMimeType()" and other FileActions functions they may not work as expected. Now it is explicitly set to the appropriate value before its use. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #7591 from ↵Morris Jobke2017-12-222-3/+89
|\ | | | | | | | | nextcloud/trigger-events-before-and-after-a-file-action-is-executed Trigger events before and after a file action is executed
| * Trigger events before and after a file action is executedDaniel Calviño Sánchez2017-12-192-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same way that other elements can know when a FileAction is registered or a default action is set this commit makes possible to be notified before and after a FileAction is executed. This is achieved by wrapping the registered action handler in a custom function that notifies the listeners before and after executing the handler itself. Due to this approach only FileActions registered through "registerAction" trigger the events, although that is not a problem as this is how the actions should be added to the FileActions anyway. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Fixed breadcrumbs testsJohn Molakvoæ (skjnldsv)2017-12-211-12/+31
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* show e2e folder icon on encrypted foldersBjoern Schiessle2017-11-201-0/+26
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Add data attribute to file list rows telling if the file is encryptedDaniel Calviño Sánchez2017-11-201-5/+33
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #7047 from ↵Björn Schießle2017-11-201-0/+9
|\ | | | | | | | | nextcloud/add-support-for-files-with-no-permissions Add support for files with no permissions
| * Add proper handling of files without permissionsDaniel Calviño Sánchez2017-11-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | Now a file gets its directory permissions only if it contained no permissions (they were undefined or null), but not if its permissions were set to "NONE". Besides that, now file actions that do not require any permission on the file to be performed can be used on files that have no permissions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Merge pull request #7051 from nextcloud/breadcrumbs-refactorMorris Jobke2017-11-132-105/+148
|\ \ | | | | | | Breadcrumbs refactor