diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-27 19:39:36 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-28 08:41:58 +0200 |
commit | 4a646789c37eda99d431de84a2c4c5fed6c46152 (patch) | |
tree | f3cca2ce60d5fb4901947dcd848374c20883d0c0 /apps/theming/tests | |
parent | 971e224ce47636e828ee9d2d8003d067bc3da0da (diff) | |
download | nextcloud-server-4a646789c37eda99d431de84a2c4c5fed6c46152.tar.gz nextcloud-server-4a646789c37eda99d431de84a2c4c5fed6c46152.zip |
Add system/light themes
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r-- | apps/theming/tests/Controller/UserThemeControllerTest.php | 3 | ||||
-rw-r--r-- | apps/theming/tests/Service/ThemesServiceTest.php | 11 | ||||
-rw-r--r-- | apps/theming/tests/Themes/DefaultThemeTest.php | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/apps/theming/tests/Controller/UserThemeControllerTest.php b/apps/theming/tests/Controller/UserThemeControllerTest.php index b925085bf41..952cd012210 100644 --- a/apps/theming/tests/Controller/UserThemeControllerTest.php +++ b/apps/theming/tests/Controller/UserThemeControllerTest.php @@ -30,6 +30,7 @@ use OCA\Theming\Themes\DefaultTheme; use OCA\Theming\Themes\DyslexiaFont; use OCA\Theming\Themes\HighContrastTheme; use OCA\Theming\Service\ThemesService; +use OCA\Theming\Themes\LightTheme; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; use OCP\IConfig; @@ -63,6 +64,7 @@ class UserThemeControllerTest extends TestCase { $this->themes = [ 'default' => $this->createMock(DefaultTheme::class), + 'light' => $this->createMock(LightTheme::class), 'dark' => $this->createMock(DarkTheme::class), 'highcontrast' => $this->createMock(HighContrastTheme::class), 'dark-highcontrast' => $this->createMock(DarkHighContrastTheme::class), @@ -91,6 +93,7 @@ class UserThemeControllerTest extends TestCase { public function dataTestThemes() { return [ ['default'], + ['light'], ['dark'], ['highcontrast'], ['dark-highcontrast'], diff --git a/apps/theming/tests/Service/ThemesServiceTest.php b/apps/theming/tests/Service/ThemesServiceTest.php index 56f96d29637..5865875cbb8 100644 --- a/apps/theming/tests/Service/ThemesServiceTest.php +++ b/apps/theming/tests/Service/ThemesServiceTest.php @@ -31,6 +31,7 @@ use OCA\Theming\Themes\DefaultTheme; use OCA\Theming\Themes\DyslexiaFont; use OCA\Theming\Themes\HighContrastTheme; use OCA\Theming\Service\ThemesService; +use OCA\Theming\Themes\LightTheme; use OCA\Theming\ThemingDefaults; use OCA\Theming\Util; use OCP\AppFramework\Http\DataResponse; @@ -81,6 +82,7 @@ class ThemesServiceTest extends TestCase { public function testGetThemes() { $expected = [ 'default', + 'light', 'dark', 'highcontrast', 'dark-highcontrast', @@ -92,6 +94,7 @@ class ThemesServiceTest extends TestCase { public function dataTestEnableTheme() { return [ + ['default', [], ['default']], ['dark', [], ['dark']], ['dark', ['dark'], ['dark']], ['opendyslexic', ['dark'], ['dark', 'opendyslexic']], @@ -207,6 +210,14 @@ class ThemesServiceTest extends TestCase { $this->config, $l10n, ), + 'light' => new LightTheme( + $util, + $this->themingDefaults, + $urlGenerator, + $imageManager, + $this->config, + $l10n, + ), 'dark' => new DarkTheme( $util, $this->themingDefaults, diff --git a/apps/theming/tests/Themes/DefaultThemeTest.php b/apps/theming/tests/Themes/DefaultThemeTest.php index b9302bb4c95..160efdba142 100644 --- a/apps/theming/tests/Themes/DefaultThemeTest.php +++ b/apps/theming/tests/Themes/DefaultThemeTest.php @@ -97,15 +97,15 @@ class DefaultThemeTest extends TestCase { } public function testGetTitle() { - $this->assertEquals('Light theme', $this->defaultTheme->getTitle()); + $this->assertEquals('System default theme', $this->defaultTheme->getTitle()); } public function testGetEnableLabel() { - $this->assertEquals('Enable the default light theme', $this->defaultTheme->getEnableLabel()); + $this->assertEquals('Enable the system default', $this->defaultTheme->getEnableLabel()); } public function testGetDescription() { - $this->assertEquals('The default light appearance.', $this->defaultTheme->getDescription()); + $this->assertEquals('Using the default system appearance.', $this->defaultTheme->getDescription()); } public function testGetMediaQuery() { |