]> source.dussan.org Git - nextcloud-server.git/commitdiff
adjust tests 38159/head
authorSimon L <szaimen@e.mail.de>
Wed, 10 May 2023 18:28:57 +0000 (20:28 +0200)
committerSimon L <szaimen@e.mail.de>
Thu, 11 May 2023 12:15:47 +0000 (14:15 +0200)
Signed-off-by: Simon L <szaimen@e.mail.de>
apps/theming/tests/CapabilitiesTest.php
apps/theming/tests/UtilTest.php

index 1c968383d53d2fb54b5355088803840e971ca08a..1a2d01d69d12457508fa443f50004c96f192077d 100644 (file)
@@ -77,8 +77,8 @@ class CapabilitiesTest extends TestCase {
                                'slogan' => 'slogan',
                                'color' => '#FFFFFF',
                                'color-text' => '#000000',
-                               'color-element' => '#aaaaaa',
-                               'color-element-bright' => '#aaaaaa',
+                               'color-element' => '#b3b3b3',
+                               'color-element-bright' => '#b3b3b3',
                                'color-element-dark' => '#FFFFFF',
                                'logo' => 'http://absolute/logo',
                                'background' => 'http://absolute/background',
@@ -109,9 +109,9 @@ class CapabilitiesTest extends TestCase {
                                'slogan' => 'slogan3',
                                'color' => '#000000',
                                'color-text' => '#ffffff',
-                               'color-element' => '#000000',
-                               'color-element-bright' => '#000000',
-                               'color-element-dark' => '#8c8c8c',
+                               'color-element' => '#4d4d4d',
+                               'color-element-bright' => '#4d4d4d',
+                               'color-element-dark' => '#4d4d4d',
                                'logo' => 'http://localhost/logo5',
                                'background' => '#000000',
                                'background-plain' => true,
@@ -125,9 +125,9 @@ class CapabilitiesTest extends TestCase {
                                'slogan' => 'slogan3',
                                'color' => '#000000',
                                'color-text' => '#ffffff',
-                               'color-element' => '#000000',
-                               'color-element-bright' => '#000000',
-                               'color-element-dark' => '#8c8c8c',
+                               'color-element' => '#4d4d4d',
+                               'color-element-bright' => '#4d4d4d',
+                               'color-element-dark' => '#4d4d4d',
                                'logo' => 'http://localhost/logo5',
                                'background' => '#000000',
                                'background-plain' => true,
@@ -178,7 +178,7 @@ class CapabilitiesTest extends TestCase {
                $this->util->expects($this->exactly(3))
                        ->method('elementColor')
                        ->with($color)
-                       ->willReturnCallback(static function (string $color, bool $brightBackground = true) use ($util) {
+                       ->willReturnCallback(static function (string $color, ?bool $brightBackground = null) use ($util) {
                                return $util->elementColor($color, $brightBackground);
                        });
 
index 789107d9fdfb82544f24cb57de2275b66f22e5b1..137038acb98dc0e15f2b44c56ff56e22e339e21d 100644 (file)
@@ -105,19 +105,34 @@ class UtilTest extends TestCase {
                $this->util->invertTextColor('');
        }
 
-       public function testElementColorDefault() {
+       public function testElementColorDefaultBlack() {
                $elementColor = $this->util->elementColor("#000000");
-               $this->assertEquals('#000000', $elementColor);
+               $this->assertEquals('#4d4d4d', $elementColor);
+       }
+
+       public function testElementColorDefaultWhite() {
+               $elementColor = $this->util->elementColor("#ffffff");
+               $this->assertEquals('#b3b3b3', $elementColor);
        }
 
-       public function testElementColorOnDarkBackground() {
+       public function testElementColorBlackOnDarkBackground() {
                $elementColor = $this->util->elementColor("#000000", false);
-               $this->assertEquals('#8c8c8c', $elementColor);
+               $this->assertEquals('#4d4d4d', $elementColor);
+       }
+
+       public function testElementColorBlackOnBrightBackground() {
+               $elementColor = $this->util->elementColor("#000000", true);
+               $this->assertEquals('#000000', $elementColor);
+       }
+
+       public function testElementColorWhiteOnBrightBackground() {
+               $elementColor = $this->util->elementColor('#ffffff', true);
+               $this->assertEquals('#b3b3b3', $elementColor);
        }
 
-       public function testElementColorOnBrightBackground() {
-               $elementColor = $this->util->elementColor('#ffffff');
-               $this->assertEquals('#aaaaaa', $elementColor);
+       public function testElementColorWhiteOnDarkBackground() {
+               $elementColor = $this->util->elementColor('#ffffff', false);
+               $this->assertEquals('#ffffff', $elementColor);
        }
 
        public function testGenerateRadioButtonWhite() {