added project detail report (#2651)
- avatars via css only - random colors for entities - improves print view - added colors for teams - added color to tag
This commit is contained in:
@@ -40,7 +40,8 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
$content = $client->getResponse()->getContent();
|
||||
$year = (new \DateTime())->format('Y');
|
||||
$this->assertStringContainsString('<h3 class="box-title">' . $year . '</h3>', $content);
|
||||
$this->assertStringContainsString('var userProfileChart' . $year . ' = new Chart(', $content);
|
||||
$this->assertStringContainsString('new Chart(', $content);
|
||||
$this->assertStringContainsString('<canvas id="userProfileChart' . $year . '"', $content);
|
||||
}
|
||||
|
||||
public function testIndexAction()
|
||||
@@ -69,7 +70,7 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
foreach ($dates as $start) {
|
||||
$year = $start->format('Y');
|
||||
$this->assertStringContainsString('<h3 class="box-title">' . $year . '</h3>', $content);
|
||||
$this->assertStringContainsString('var userProfileChart' . $year . ' = new Chart(', $content);
|
||||
$this->assertStringContainsString('<canvas id="userProfileChart' . $year . '"', $content);
|
||||
}
|
||||
|
||||
$this->assertHasProfileBox($client, 'John Doe');
|
||||
@@ -80,9 +81,9 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
{
|
||||
$profileBox = $client->getCrawler()->filter('div.box-user-profile');
|
||||
$this->assertEquals(1, $profileBox->count());
|
||||
$profileAvatar = $profileBox->filter('img.img-circle');
|
||||
$profileAvatar = $profileBox->filter('span.avatar');
|
||||
$this->assertEquals(1, $profileAvatar->count());
|
||||
$alt = $profileAvatar->attr('alt');
|
||||
$alt = $profileAvatar->attr('title');
|
||||
|
||||
$this->assertEquals($username, $alt);
|
||||
}
|
||||
@@ -131,7 +132,6 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals(UserFixtures::USERNAME_USER, $user->getUsername());
|
||||
$this->assertEquals('John Doe', $user->getAlias());
|
||||
$this->assertEquals('Developer', $user->getTitle());
|
||||
$this->assertEquals(UserFixtures::DEFAULT_AVATAR, $user->getAvatar());
|
||||
$this->assertEquals('john_user@example.com', $user->getEmail());
|
||||
$this->assertTrue($user->isEnabled());
|
||||
|
||||
@@ -140,7 +140,6 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
'user_edit' => [
|
||||
'alias' => 'Johnny',
|
||||
'title' => 'Code Monkey',
|
||||
'avatar' => '/fake/image.jpg',
|
||||
'email' => 'updated@example.com',
|
||||
]
|
||||
]);
|
||||
@@ -157,7 +156,6 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals(UserFixtures::USERNAME_USER, $user->getUsername());
|
||||
$this->assertEquals('Johnny', $user->getAlias());
|
||||
$this->assertEquals('Code Monkey', $user->getTitle());
|
||||
$this->assertEquals('/fake/image.jpg', $user->getAvatar());
|
||||
$this->assertEquals('updated@example.com', $user->getEmail());
|
||||
$this->assertTrue($user->isEnabled());
|
||||
}
|
||||
@@ -172,7 +170,6 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
'user_edit' => [
|
||||
'alias' => 'Johnny',
|
||||
'title' => 'Code Monkey',
|
||||
'avatar' => '/fake/image.jpg',
|
||||
'email' => 'updated@example.com',
|
||||
'enabled' => false,
|
||||
]
|
||||
@@ -190,7 +187,6 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals(UserFixtures::USERNAME_USER, $user->getUsername());
|
||||
$this->assertEquals('Johnny', $user->getAlias());
|
||||
$this->assertEquals('Code Monkey', $user->getTitle());
|
||||
$this->assertEquals('/fake/image.jpg', $user->getAvatar());
|
||||
$this->assertEquals('updated@example.com', $user->getEmail());
|
||||
$this->assertFalse($user->isEnabled());
|
||||
}
|
||||
|
||||
64
tests/Controller/Reporting/ProjectDetailsControllerTest.php
Normal file
64
tests/Controller/Reporting/ProjectDetailsControllerTest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Tests\Controller\ControllerBaseTest;
|
||||
use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
class ProjectDetailsControllerTest extends ControllerBaseTest
|
||||
{
|
||||
public function testReportIsSecure()
|
||||
{
|
||||
$this->assertUrlIsSecured('/reporting/project_details');
|
||||
}
|
||||
|
||||
public function testReport()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
$customers = new CustomerFixtures();
|
||||
$customers->setIsVisible(true);
|
||||
$customers->setAmount(1);
|
||||
$customers = $this->importFixture($customers);
|
||||
|
||||
$projects = new ProjectFixtures();
|
||||
$projects->setCustomers($customers);
|
||||
$projects->setAmount(1);
|
||||
$projects->setIsVisible(true);
|
||||
$projects = $this->importFixture($projects);
|
||||
|
||||
$activities = new ActivityFixtures();
|
||||
$activities->setAmount(1);
|
||||
$activities->setIsGlobal(true);
|
||||
$activities = $this->importFixture($activities);
|
||||
|
||||
$timesheets = new TimesheetFixtures();
|
||||
$timesheets->setAmount(50);
|
||||
$timesheets->setActivities($activities);
|
||||
$this->importFixture($timesheets);
|
||||
|
||||
$this->assertAccessIsGranted($client, '/reporting/project_details');
|
||||
$this->assertHasNoEntriesWithFilter($client);
|
||||
|
||||
$this->assertAccessIsGranted($client, '/reporting/project_details?project=' . $projects[0]->getId());
|
||||
$rows = $client->getCrawler()->filterXPath("//form[@id='project-details-form']");
|
||||
self::assertEquals(1, $rows->count());
|
||||
|
||||
$rows = $client->getCrawler()->filterXPath("//div[@id='reporting-content']/div[@class='nav-tabs-custom']");
|
||||
self::assertGreaterThan(1, $rows->count());
|
||||
}
|
||||
}
|
||||
@@ -527,10 +527,6 @@ class TimesheetControllerTest extends ControllerBaseTest
|
||||
]
|
||||
]);
|
||||
|
||||
if (!$client->getResponse()->isRedirect()) {
|
||||
dd($response->getStatusCode(), $response->getContent());
|
||||
}
|
||||
|
||||
$this->assertIsRedirect($client, $this->createUrl('/timesheet/'));
|
||||
$client->followRedirect();
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
@@ -268,7 +268,6 @@ class UserControllerTest extends ControllerBaseTest
|
||||
'plainPassword' => ['first' => 'sdfsdf123'],
|
||||
'alias' => 'ycvyxcb',
|
||||
'title' => '34rtwrtewrt',
|
||||
'avatar' => 'asdfawer',
|
||||
'email' => '',
|
||||
]
|
||||
],
|
||||
@@ -286,7 +285,6 @@ class UserControllerTest extends ControllerBaseTest
|
||||
'plainPassword' => ['first' => 'sdfsdf123', 'second' => 'sdfxxxxxxx'],
|
||||
'alias' => 'ycvyxcb',
|
||||
'title' => '34rtwrtewrt',
|
||||
'avatar' => 'asdfawer',
|
||||
'email' => 'ydfbvsdfgs',
|
||||
]
|
||||
],
|
||||
@@ -304,7 +302,6 @@ class UserControllerTest extends ControllerBaseTest
|
||||
'plainPassword' => ['first' => 'test123', 'second' => 'test123'],
|
||||
'alias' => 'ycvyxcb',
|
||||
'title' => '34rtwrtewrt',
|
||||
'avatar' => 'asdfawer',
|
||||
'email' => 'ydfbvsdfgs@example.com',
|
||||
]
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user