Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unit tests; Updated import descriptions #301

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lang/en/importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
return [
'clockify_time_entries' => [
'name' => 'Clockify Time Entries',
'description' => '1. First make sure that you set the Date format to "MM/DD/YYYY" and the Time format to "12-hour" in the user settings.<br> '.
'2. Go to REPORTS -> TIME -> Detailed in the navigation on the left. <br>'.
'3. Now select the date range that you want to export in the right top. '.
'description' => '1. First make sure that you set the Date format to "MM/DD/YYYY" and the Time format to "12-hour" in the user settings.<br>'.
'2. In the same preferences page change the language of Clockfiy to English.<br>'.
'3. Go to REPORTS -> TIME -> Detailed in the navigation on the left. <br>'.
'4. Now select the date range that you want to export in the right top. '.
'It is currently not possible to select more than one year. You can export each year separately and import them one after another .'.
'<br> 4. Now click Export -> Save as CSV. The Export dropdown is in the header of the export table left of the printer symbol. '.
'<br><br>Before you import make sure that the Timezone settings in Clockify are the same as in solidtime.',
],
'clockify_projects' => [
'name' => 'Clockify Projects',
'description' => '1. Go to PROJECTS in the navigation on the left.<br> '.
'2. Now click on the three dots on the right of the project that you want to export and select Export.<br> '.
'3. Now click Export -> Save as CSV. The Export dropdown is in the header of the export table in the top right corner.',
'description' => '1. Make sure to set the language of Clockify to English in "Preferences -> General".<br>'.
'2. Go to PROJECTS in the navigation on the left.<br> '.
'3. Now click on the three dots on the right of the project that you want to export and select Export.<br> '.
'4. Now click Export -> Save as CSV. The Export dropdown is in the header of the export table in the top right corner.',
],
'toggl_data_importer' => [
'name' => 'Toggl Data Importer',
Expand Down
18 changes: 10 additions & 8 deletions tests/Unit/Endpoint/Api/V1/Public/PublicReportEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function test_show_fails_with_not_found_if_report_is_expired(): void
public function test_show_returns_detailed_information_about_the_report(): void
{
// Arrange
$timezone = 'Europe/Vienna';
$reportDto = new ReportPropertiesDto;
$organization = Organization::factory()->create();
$reportDto->start = now()->subDays(2);
Expand All @@ -87,7 +88,7 @@ public function test_show_returns_detailed_information_about_the_report(): void
$reportDto->subGroup = TimeEntryAggregationType::Task;
$reportDto->historyGroup = TimeEntryAggregationTypeInterval::Day;
$reportDto->weekStart = Weekday::Monday;
$reportDto->timezone = 'Europe/Vienna';
$reportDto->timezone = $timezone;
$report = Report::factory()->forOrganization($organization)->public()->create([
'public_until' => null,
'properties' => $reportDto,
Expand Down Expand Up @@ -182,7 +183,7 @@ public function test_show_returns_detailed_information_about_the_report(): void
'grouped_type' => TimeEntryAggregationTypeInterval::Day->value,
'grouped_data' => [
[
'key' => now()->subDays(2)->toDateString(),
'key' => now()->timezone($timezone)->subDays(2)->toDateString(),
'seconds' => 0,
'cost' => 0,
'grouped_type' => null,
Expand All @@ -191,7 +192,7 @@ public function test_show_returns_detailed_information_about_the_report(): void
'color' => null,
],
[
'key' => now()->subDays(1)->toDateString(),
'key' => now()->timezone($timezone)->subDays(1)->toDateString(),
'seconds' => 300,
'cost' => 0,
'grouped_type' => null,
Expand All @@ -200,7 +201,7 @@ public function test_show_returns_detailed_information_about_the_report(): void
'color' => null,
],
[
'key' => now()->toDateString(),
'key' => now()->timezone($timezone)->toDateString(),
'seconds' => 0,
'cost' => 0,
'grouped_type' => null,
Expand Down Expand Up @@ -320,6 +321,7 @@ public function test_show_returns_detailed_information_about_the_report_with_all
public function test_if_the_resources_behind_the_filters_no_longer_exist_the_report_ignores_those_filters_but_this_does_not_increase_the_visible_data(): void
{
// Arrange
$timezone = 'Europe/Vienna';
$organization = Organization::factory()->create();
$client = Client::factory()->forOrganization($organization)->create();
$project = Project::factory()->forClient($client)->forOrganization($organization)->create();
Expand All @@ -341,7 +343,7 @@ public function test_if_the_resources_behind_the_filters_no_longer_exist_the_rep
$reportDto->subGroup = TimeEntryAggregationType::Task;
$reportDto->historyGroup = TimeEntryAggregationTypeInterval::Day;
$reportDto->weekStart = Weekday::Monday;
$reportDto->timezone = 'Europe/Vienna';
$reportDto->timezone = $timezone;
$reportDto->setMemberIds([Str::uuid()->toString()]);
$reportDto->setClientIds([Str::uuid()->toString()]);
$reportDto->setProjectIds([Str::uuid()->toString()]);
Expand Down Expand Up @@ -382,7 +384,7 @@ public function test_if_the_resources_behind_the_filters_no_longer_exist_the_rep
'grouped_type' => TimeEntryAggregationTypeInterval::Day->value,
'grouped_data' => [
[
'key' => now()->subDays(2)->toDateString(),
'key' => now()->timezone($timezone)->subDays(2)->toDateString(),
'seconds' => 0,
'cost' => 0,
'grouped_type' => null,
Expand All @@ -391,7 +393,7 @@ public function test_if_the_resources_behind_the_filters_no_longer_exist_the_rep
'color' => null,
],
[
'key' => now()->subDays(1)->toDateString(),
'key' => now()->timezone($timezone)->subDays(1)->toDateString(),
'seconds' => 0,
'cost' => 0,
'grouped_type' => null,
Expand All @@ -400,7 +402,7 @@ public function test_if_the_resources_behind_the_filters_no_longer_exist_the_rep
'color' => null,
],
[
'key' => now()->toDateString(),
'key' => now()->timezone($timezone)->toDateString(),
'seconds' => 0,
'cost' => 0,
'grouped_type' => null,
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Endpoint/Api/V1/TimeEntryEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function test_index_endpoint_filter_only_full_dates_returns_time_entries_
{
// Arrange
$now = Carbon::create(2024, 1, 1, 12, 0, 0, 'Europe/Vienna');
$this->freezeTime($now);
$this->travelTo($now);
$data = $this->createUserWithPermission([
'time-entries:view:own',
]);
Expand Down Expand Up @@ -310,7 +310,7 @@ public function test_index_endpoint_filter_only_full_dates_returns_time_entries_
{
// Arrange
$now = Carbon::create(2024, 1, 1, 12, 0, 0, 'Europe/Vienna');
$this->freezeTime($now);
$this->travelTo($now);
$data = $this->createUserWithPermission([
'time-entries:view:own',
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/BillableRateServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class BillableRateServiceTest extends TestCaseWithDatabase

private BillableRateService $billableRateService;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
$this->billableRateService = app(BillableRateService::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/DashboardServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DashboardServiceTest extends TestCase

protected DashboardService $dashboardService;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
$this->dashboardService = app(DashboardService::class);
Expand Down
Loading