financial year setting + new users working time per year report (#2547)

This commit is contained in:
Kevin Papst
2021-05-14 18:40:48 +02:00
committed by GitHub
parent a9da5f8476
commit f7aa3c1e13
59 changed files with 1690 additions and 217 deletions

View File

@@ -28,6 +28,11 @@ class ReportUsersListControllerTest extends ControllerBaseTest
$this->importFixture($fixture);
}
public function testYearlyListIsSecure()
{
$this->assertUrlIsSecured('/reporting/yearly_users_list');
}
public function testWeeklyListIsSecure()
{
$this->assertUrlIsSecured('/reporting/weekly_users_list');
@@ -38,6 +43,11 @@ class ReportUsersListControllerTest extends ControllerBaseTest
$this->assertUrlIsSecured('/reporting/monthly_users_list');
}
public function testYearlyUsersListIsSecureForUserRole()
{
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/yearly_users_list');
}
public function testWeeklyUsersListIsSecureForUserRole()
{
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/weekly_users_list');
@@ -48,6 +58,16 @@ class ReportUsersListControllerTest extends ControllerBaseTest
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/monthly_users_list');
}
public function testYearlyUsersReport()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
$this->importReportingFixture(User::ROLE_TEAMLEAD);
$this->assertAccessIsGranted($client, '/reporting/yearly_users_list');
self::assertStringContainsString('<div class="box-body yearly-user-list-reporting-box', $client->getResponse()->getContent());
$select = $client->getCrawler()->filterXPath("//select[@id='user']");
self::assertEquals(0, $select->count());
}
public function testWeeklyUsersReport()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);