improve color chooser and name validation (#2622)

This commit is contained in:
Kevin Papst
2021-06-25 16:35:16 +02:00
committed by GitHub
parent 0d5e0b3e80
commit 3d1fba650b
11 changed files with 77 additions and 40 deletions

View File

@@ -136,7 +136,7 @@ class SystemConfigurationTest extends TestCase
$this->assertEquals(99, $sut->find('timesheet.active_entries.hard_limit'));
$this->assertTrue($sut->find('theme.colors_limited'));
$this->assertTrue($sut->isThemeColorsLimited());
$this->assertEquals(['Maroon' => '#800000', 'Brown' => '#a52a2a', 'Red' => '#ff0000', 'Orange' => '#ffa500', '#ffffff' => '#ffffff', '#000000' => '#000000'], $sut->getThemeColorChoices());
$this->assertEquals('Maroon|#800000,Brown|#a52a2a,Red|#ff0000,Orange|#ffa500,#ffffff,,|#000000', $sut->getThemeColorChoices());
}
public function testDefaultWithLoader()
@@ -148,6 +148,7 @@ class SystemConfigurationTest extends TestCase
$this->assertEquals(7, $sut->find('timesheet.active_entries.hard_limit'));
$this->assertFalse($sut->isSamlActive());
$this->assertFalse($sut->find('theme.colors_limited'));
$this->assertEquals('Europe/London', $sut->default('defaults.customer.timezone'));
}
public function testDefaultWithMixedConfigs()
@@ -160,7 +161,7 @@ class SystemConfigurationTest extends TestCase
]);
$this->assertFalse($sut->find('timesheet.rules.allow_future_times'));
$this->assertTrue($sut->isSamlActive());
$this->assertNull($sut->getThemeColorChoices());
$this->assertEquals('Maroon|#800000,Brown|#a52a2a,Red|#ff0000,Orange|#ffa500,#ffffff,,|#000000', $sut->getThemeColorChoices());
$this->assertEquals('2020-03-27', $sut->getFinancialYearStart());
}