Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNina Pypchenko <22447785+nina-py@users.noreply.github.com>2021-01-10 11:14:49 +0300
committernpmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>2021-01-14 20:36:17 +0300
commitc14638877c0bb0533a72842ccc7c73d88f5122f0 (patch)
treebac7b25321ce61e30b578f51a9692ff52955edc8 /apps/files/tests
parent97743df3fcd6243f9b2755a4c86586b61a96e793 (diff)
Add "Crop image previews" setting to files
Added a new user setting that toggles cropping on image previews in grid view. True (default value): crops each image to a square. False: keep original aspect ratio. Signed-off-by: Nina Pypchenko <22447785+nina-py@users.noreply.github.com> Closes #18439. Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/Controller/ApiControllerTest.php13
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php2
2 files changed, 15 insertions, 0 deletions
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php
index afef351aea7..1fb6490f143 100644
--- a/apps/files/tests/Controller/ApiControllerTest.php
+++ b/apps/files/tests/Controller/ApiControllerTest.php
@@ -246,4 +246,17 @@ class ApiControllerTest extends TestCase {
$this->assertEquals($expected, $actual);
}
+
+ public function testCropImagePreviews() {
+ $crop = true;
+
+ $this->config->expects($this->once())
+ ->method('setUserValue')
+ ->with($this->user->getUID(), 'files', 'crop_image_previews', $crop);
+
+ $expected = new Http\Response();
+ $actual = $this->apiController->cropImagePreviews($crop);
+
+ $this->assertEquals($expected, $actual);
+ }
}
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index 2b40697642c..fc2b82de9c8 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -135,6 +135,7 @@ class ViewControllerTest extends TestCase {
[$this->user->getUID(), 'files', 'file_sorting', 'name', 'name'],
[$this->user->getUID(), 'files', 'file_sorting_direction', 'asc', 'asc'],
[$this->user->getUID(), 'files', 'show_hidden', false, false],
+ [$this->user->getUID(), 'files', 'crop_image_previews', true, true],
[$this->user->getUID(), 'files', 'show_grid', true],
]);
@@ -316,6 +317,7 @@ class ViewControllerTest extends TestCase {
'defaultFileSorting' => 'name',
'defaultFileSortingDirection' => 'asc',
'showHiddenFiles' => 0,
+ 'cropImagePreviews' => 1,
'fileNotFound' => 0,
'allowShareWithLink' => 'yes',
'appNavigation' => $nav,