summaryrefslogtreecommitdiffstats
path: root/core/js/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge all setup checks into one controllerMorris Jobke2018-06-131-10/+120
| | | | | | * renamed hasMissingIndexes to missingIndexes Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #9836 from ↵Morris Jobke2018-06-132-10/+12
|\ | | | | | | | | nextcloud/feature/noid/merge-tips-and-tricks-into-setup-checks Merge tips & tricks section into setup checks
| * Merge tips & tricks section into setup checksMorris Jobke2018-06-132-10/+12
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Fix wrong hint about missing indexesMorris Jobke2018-06-131-10/+20
|/ | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add referrer policy setup checkRoeland Jago Douma2018-06-041-4/+207
| | | | | | | | | | | | | | | | Fixes #9122 Based on https://www.w3.org/TR/referrer-policy/ and https://scotthelme.co.uk/a-new-security-header-referrer-policy/ Setting a sane Referrer-Policy will tell the browser if/when to send referrer headers when accessing a link from Nextcloud. When configured properly this results in less tracking and less leaking of (possibly) sensitive urls * Fix tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix ids of permission checkboxes for sharesDaniel Calviño Sánchez2018-04-181-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | The ids of permission checkboxes for shares were generated using the "shareWith" field of the share. The "shareWith" field can contain spaces (as spaces are allowed, for example, in user or circle names), so this could cause the id attribute of the HTML element to contain spaces too, which is forbidden by the HTML specification. It is not just a "formal" issue, though; when the list was rendered, if the id contained a space the selector to get the checkbox element was wrong (as it ended being something like "#canEdit-view1-name with spaces") and thus the initial state of the checkbox was not properly set. Besides that, "shareWith" can contain too single quotes, which would even cause the jQuery selector to abort the search and leave the UI in an invalid state. Instead of adding more cases to the regular expression to escape special characters and apply it too when the ids are created now the ids of permission checkboxes for shares are based on the "shareId" field instead of on "shareWith", as "shareId" is expected to always contain compatible characters. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Keep showing the working icon while there are pending operationsDaniel Calviño Sánchez2018-03-211-0/+50
| | | | | | | | | | | | Before, whenever a pending operation (getting the suggestions, confirming a share or selecting a recipient) finished the working icon was hidden and the confirm button was shown again, even if there were other pending operations (the most common case is typing slowly on the input field, as several operations to get the suggestions could pile if the server response is not received fast enough). Now, the working icon is not hidden until the last pending operation finishes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Reuse last suggestions if the same parameters are usedDaniel Calviño Sánchez2018-03-211-0/+174
| | | | | | | | | | When a share is confirmed the suggestions are got to check if there is an exact match. Usually the suggestions were already got with the same parameters in order to fill the autocomplete dropdown, so to avoid a superfluous request now the last suggestions are reused when got again, although only if the same parameters as the last time are used. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Confirm a share also by pressing enter on the input fieldDaniel Calviño Sánchez2018-03-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides confirming a share by clicking on the confirm button now it is possible to do it by pressing enter on the input field. Clicking on the confirm button implicitly hides the autocomplete dropdown. On the other hand, pressing enter on the input field does not, so the autocompletion must be disabled and closed when the confirmation begins and then enabled again once it finishes. Otherwise the autocomplete dropdown would be visible and it would be possible to interact with it while the share is being confirmed. The order in which the input field and the autompletion are disabled is important. Internally, the autocompletion sets a timeout when the input field is modified that requests the suggestions to the server and then shows them in the dropdown. That timeout is not cancelled when the autocompletion is disabled, but when the input field loses its focus and the autocompletion is not disabled. Therefore, the input field has to be disabled (which causes it to lose the focus) before the autocompletion is disabled. Otherwise it could happen that while a share is being confirmed the timeout ends, so an autocompletion request is sent and then, once the share is successfully confirmed and thus the autocompletion is enabled again, the request is received and the autocomplete dropdown is shown with the old suggestions. Strange, but possible nevertheless ;-) Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add a share when clicking on the confirm buttonDaniel Calviño Sánchez2018-03-201-0/+358
| | | | | | | | | Clicking on the confirm button now adds a share, but only if there is just a single exact match. If there are no exact matches or there is more than one exact match no share is added, and the autocomplete dropdown is shown again with all the suggestions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Return also exact matches besides all suggestionsDaniel Calviño Sánchez2018-03-201-0/+248
| | | | | | | | | | | | | | | | | "_getSuggestions" returned all the suggestions from the server, which are composed by exact matches and partial matches. Now the exact matches are also returned on their own parameter. This will be used by the button to confirm a share. Note that until now the order of the suggestions was "exact users, partial users, exact groups, partial groups, exact..."; this commit also changes that order to become "exact users, exact groups, exact..., partial users, partial groups, partial...". This is not a problem, as the suggestions were used in the autocomplete dropdown, and this new order is arguably better than the old one, as all exact matches appear now at the beginning. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Show an error when getting the suggestions succeeds with failure contentDaniel Calviño Sánchez2018-03-201-3/+6
| | | | | | | | Instead of silently failing now an error is shown to the user when the ajax call to get the suggestions succeeds yet it returns failure content (for example, if an "OCSBadRequestException" was thrown in the server). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Use "showTemporary" instead of explicitly hiding the notificationDaniel Calviño Sánchez2018-03-201-4/+4
| | | | | | | | | | | | | | "OC.Notification.hide" expects the notification to be hidden to be passed as an argument. As it was being used to show a temporary notification the combination of "OC.Notification.show" and "OC.Notification.hide" was replaced by a single call to "OC.Notification.showTemporary". The timeout could have been specified in the options of the call, but it was left to the default value (7 seconds) for consistency with other notifications. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Move stub setup outside the test methodDaniel Calviño Sánchez2018-03-201-4/+11
| | | | | | | | | | | Stubs should be restored outside the test method in which they are used to ensure that they are properly restored no matter the result of the test (for example, if an exception is thrown). Besides that, this will make possible to reuse the stub in other sibling tests without having to explicitly setup it in them. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add autocompletion tests for each type of shareDaniel Calviño Sánchez2018-03-201-25/+283
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add tests for exact search results already shared withDaniel Calviño Sánchez2018-03-201-0/+274
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add tests for emails and circles already shared withDaniel Calviño Sánchez2018-03-201-1/+120
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Adjust search term to testDaniel Calviño Sánchez2018-03-201-3/+3
| | | | | | | | As the server response is faked the search term is ignored in the tests. However, it is clearer to use a search term that would make the server return what the faked response contains. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Replace information icon with confirmation button in share inputJan-Christoph Borchardt2018-03-201-16/+0
| | | | | | | The confirmation button right now is just an icon; its behaviour will be added in the following commits. Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Add CSRF token controller to retrieve the current CSRF tokenChristoph Wurst2018-03-081-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix share capabilities JS testsVincent Petry2018-02-271-1/+24
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Update tests for indeterminate state, fix slashes not being escapedMaximilian Wende2018-02-161-1/+49
| | | | Signed-off-by: Maximilian Wende <dasisdormax@mailbox.org>
* There was an error loading → could not loadAllan Nordhøy2018-01-201-1/+1
|
* Spelling: FreeTypeAllan Nordhøy2018-01-141-2/+2
|
* Merge pull request #7635 from Abijeet/bug-7106Roeland Jago Douma2018-01-101-0/+61
|\ | | | | Fixes password input being prompted every time.
| * Add extra test cases for password confirmationDaniel Calviño Sánchez2018-01-101-2/+26
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Added test cases for the fix for the password confirmation box appearing ↵Abijeet2018-01-101-0/+37
| | | | | | | | | | | | repeatedly. Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* | Fix testsJulius Härtl2018-01-081-2/+0
|/ | | | | | | | The avatar plugin should not change the display element, since the avatar is always shown by default and the display value is up to the developers Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #7526 from ↵Morris Jobke2018-01-031-0/+427
|\ | | | | | | | | nextcloud/make-possible-for-apps-to-disable-the-navigation-bar-slide-gesture Make possible for apps to disable the navigation bar slide gesture
| * Force the drag to end when the navigation bar Snap is disabled by an appDaniel Calviño Sánchez2017-12-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a Snap was disabled it stopped listening to the events, but if a drag gesture was being performed it was kept as active. Thus, when the Snap was enabled again move events were handled as if the Snap had never been disabled, causing the gesture handling to continue where it was left. When the Snap for the navigation bar is disabled by an app it could be as a result of a different gesture being recognized by the app (for example, a vertical swipe) once both gestures have started. In that case when the other gesture ends and the Snap is enabled again any pointer movement will cause the navigation bar to slide until an "up" event is triggered again (obviously not the desired behaviour). Due to all this now when the Snap for the navigation bar is disabled by an app the current drag gesture for the navigation bar is ended. Note that this was added as a parameter to "Snap.disable()" instead of done unconditionally to keep back-compatibility with the previous behaviour (probably not really needed as it is unlikely that any app is using the Snap library relying on that behaviour... but just in case). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Make possible for apps to disallow the navigation bar slide gestureDaniel Calviño Sánchez2017-12-141-0/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On narrow screens a slide gesture can be used to open or close the navigation bar. However that gesture could conflict at times with the gestures used by certain apps (for example, if the right sidebar is open the user may expect to close it by dragging it to the right, but that could open the navigation bar instead depending on how the events are handled). This commit makes possible for apps to disallow and allow again that slide gesture. In any case, note that applications can only disallow the gesture, but they can not enable it. That is, they can prevent the gesture from being used on narrow screens, but they can not make the gesture work on wide screens; they are always limited by the base rules set by the core. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Add unit tests for the navigation bar slide gestureDaniel Calviño Sánchez2017-12-141-0/+104
| | | | | | | | | | | | | | | | The slide gesture is enabled or disabled depending on the width of the browser window. In order to easily control that width the karma-viewport plugin is now used in the unit tests. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Fix testsRoeland Jago Douma2017-12-191-77/+60
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add testsRoeland Jago Douma2017-12-131-9/+50
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #6079 from nextcloud/fix-antivirusblizzz2017-12-111-2/+16
|\ | | | | Parse Sabre Exception in OC.Files.Client and file-upload
| * Parse Sabre Exception in OC.Files.Client and file-uploadVincent Petry2017-11-131-2/+16
| | | | | | | | | | | | | | | | In case of error, instead of a generic error message, an upload will display whichever message is returned in the Sabre Exception, if applicable. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Merge pull request #6670 from nextcloud/handle-encryption-state-in-web-interfaceTobias Kaminsky2017-12-062-2/+18
|\ \ | | | | | | Handle encryption state in web interface
| * | show e2e folder icon on encrypted foldersBjoern Schiessle2017-11-201-0/+7
| | | | | | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
| * | check for encryption state on propfindBjoern Schiessle2017-11-201-2/+11
| | | | | | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | | Merge pull request #7222 from nextcloud/fix-filerow-avatarsblizzz2017-11-271-12/+135
|\ \ \ | | | | | | | | Fix filerow avatars
| * | | fix sorting test on phantomjsArthur Schiwon2017-11-241-15/+29
| | | | | | | | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * | | rip out obsolete recipientsDisplayNameArthur Schiwon2017-11-231-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | also needs tests adjustements, and this also brings in natural sorting Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * | | adjust tests and apply sortingArthur Schiwon2017-11-231-24/+108
| | | | | | | | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * | | adjust, fix and extend testsArthur Schiwon2017-11-231-12/+39
| |/ / | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* / / Fix unit testsMorris Jobke2017-11-271-25/+25
|/ / | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Merge pull request #7047 from ↵Björn Schießle2017-11-201-32/+18
|\ \ | |/ |/| | | | | nextcloud/add-support-for-files-with-no-permissions Add support for files with no permissions
| * Set read permission for files based on the data returned by the serverDaniel Calviño Sánchez2017-11-021-13/+14
| | | | | | | | | | | | | | | | Now that the permissions returned by the server specify whether a file is readable or not the frontend no longer needs to assume that every file is readable. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Fix tests for parsing of permissionsDaniel Calviño Sánchez2017-11-021-16/+1
| | | | | | | | | | | | | | Now that these tests are executed they are revealed to be partially obsolete; they were fixed to match the current parsing behaviour. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Fix asserts silently not executedDaniel Calviño Sánchez2017-11-021-5/+5
| | | | | | | | | | | | | | The first parameter of "apply" must be the object to act as "this", and the Promise callback gets the parameters provided in the "resolve". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Merge pull request #6788 from staabm/masterLukas Reschke2017-11-081-11/+11
|\ \ | | | | | | Prevent XSS in links which open a new browser window