diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-08-26 15:02:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-26 15:02:21 +0200 |
commit | 53725d4d15680f7254427dac92e231c3fe669d0b (patch) | |
tree | 6dbfe408e39b693a15b96843d486b8080cbf450c /apps/theming/tests | |
parent | 00bb9294eddafd362042152ac7ab9ab0ec716ac3 (diff) | |
parent | a7273f1658ecbd51fbc68b35afdf32e9836dac13 (diff) | |
download | nextcloud-server-53725d4d15680f7254427dac92e231c3fe669d0b.tar.gz nextcloud-server-53725d4d15680f7254427dac92e231c3fe669d0b.zip |
Merge pull request #771 from nextcloud/theming-fixes
Theming: Fix missing color usage
Diffstat (limited to 'apps/theming/tests')
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 101 |
1 files changed, 97 insertions, 4 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 688e3d62bff..da2137e9da0 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -383,7 +383,29 @@ class ThemingControllerTest extends TestCase { $expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . 'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' . "}\n"; - + $expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' . + '.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' . + '.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' . + '.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' . + '.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' . + 'border: 1px solid '.$color .';'. + 'background-color: '.$color.';'. + 'opacity: 0.8' . + "}\n" . + '.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' . + '.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' . + 'border: 1px solid '.$color.';'. + 'background-color: '.$color.';'. + 'opacity: 1.0;' . + "}\n"; + $expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n"; + $expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' . + 'border: 1px solid ' . $color . ';' . + 'color: ' . $color . ';' . + "}\n"; + $expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' . + 'color: ' . $color . ';' . + "}\n"; $expectedData .= ' #firstrunwizard .firstrunwizard-header { background-color: ' . $color . '; @@ -406,6 +428,7 @@ class ThemingControllerTest extends TestCase { public function testGetStylesheetWithOnlyColorInvert() { $color = '#fff'; + $elementColor = '#555555'; $this->config ->expects($this->at(0)) @@ -442,7 +465,29 @@ class ThemingControllerTest extends TestCase { $expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . 'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' . "}\n"; - + $expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' . + '.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' . + '.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' . + '.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' . + '.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' . + 'border: 1px solid #555555;'. + 'background-color: #555555;'. + 'opacity: 0.8' . + "}\n" . + '.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' . + '.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' . + 'border: 1px solid #555555;'. + 'background-color: #555555;'. + 'opacity: 1.0;' . + "}\n"; + $expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n"; + $expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' . + 'border: 1px solid ' . $color . ';' . + 'color: ' . $elementColor . ';' . + "}\n"; + $expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' . + 'color: ' . $elementColor . ';' . + "}\n"; $expectedData .= ' #firstrunwizard .firstrunwizard-header { background-color: ' . $color . '; @@ -458,6 +503,7 @@ class ThemingControllerTest extends TestCase { $expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n"; $expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n"; $expectedData .= '.nc-theming-contrast {color: #000000}' . "\n"; + $expectedData .= '.ui-widget-header { color: #000000; }' . "\n"; $expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css'); @@ -585,6 +631,29 @@ class ThemingControllerTest extends TestCase { $expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . 'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' . "}\n"; + $expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' . + '.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' . + '.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' . + '.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' . + '.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' . + 'border: 1px solid '.$color .';'. + 'background-color: '.$color.';'. + 'opacity: 0.8' . + "}\n" . + '.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' . + '.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' . + 'border: 1px solid '.$color.';'. + 'background-color: '.$color.';'. + 'opacity: 1.0;' . + "}\n"; + $expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n"; + $expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' . + 'border: 1px solid ' . $color . ';' . + 'color: ' . $color . ';' . + "}\n"; + $expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' . + 'color: ' . $color . ';' . + "}\n"; $expectedData .= ' #firstrunwizard .firstrunwizard-header { background-color: ' . $color . '; @@ -624,6 +693,7 @@ class ThemingControllerTest extends TestCase { public function testGetStylesheetWithAllCombinedInverted() { $color = '#fff'; + $elementColor = '#555555'; $this->config ->expects($this->at(0)) @@ -646,7 +716,6 @@ class ThemingControllerTest extends TestCase { ->with('theming', 'backgroundMime', '') ->willReturn('image/png'); - $expectedData = sprintf( '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n", $color); @@ -661,6 +730,29 @@ class ThemingControllerTest extends TestCase { $expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . 'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' . "}\n"; + $expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' . + '.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' . + '.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' . + '.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' . + '.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' . + 'border: 1px solid #555555;'. + 'background-color: #555555;'. + 'opacity: 0.8' . + "}\n" . + '.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' . + '.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' . + 'border: 1px solid #555555;'. + 'background-color: #555555;'. + 'opacity: 1.0;' . + "}\n"; + $expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n"; + $expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' . + 'border: 1px solid ' . $color . ';' . + 'color: ' . $elementColor . ';' . + "}\n"; + $expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' . + 'color: ' . $elementColor . ';' . + "}\n"; $expectedData .= ' #firstrunwizard .firstrunwizard-header { background-color: ' . $color . '; @@ -694,8 +786,9 @@ class ThemingControllerTest extends TestCase { $expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n"; $expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n"; $expectedData .= '.nc-theming-contrast {color: #000000}' . "\n"; - $expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css'); + $expectedData .= '.ui-widget-header { color: #000000; }' . "\n"; + $expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css'); $expected->cacheFor(3600); $expected->addHeader('Expires', date(\DateTime::RFC2822, 123)); @$this->assertEquals($expected, $this->themingController->getStylesheet()); |