mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
fix shared report endpoint test to check new structure that includes organization format properties, format
This commit is contained in:
committed by
Constantin Graf
parent
77ff4d88be
commit
ff9672e155
@@ -15,6 +15,7 @@ class CurrencyController extends Controller
|
||||
* Get all currencies
|
||||
*
|
||||
* @response array{code: string, name: string, symbol: string}[]
|
||||
*
|
||||
* @operationId getCurrencies
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
@@ -26,7 +27,7 @@ class CurrencyController extends Controller
|
||||
'code' => $currency->getCurrencyCode(),
|
||||
'name' => $currency->getName(),
|
||||
'symbol' => $currencyService->getCurrencySymbol($currency->getCurrencyCode()),
|
||||
],
|
||||
],
|
||||
ISOCurrencyProvider::getInstance()->getAvailableCurrencies()
|
||||
));
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ class OrganizationResource extends BaseResource
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$currencyService = app(CurrencyService::class);
|
||||
$currencyService = app(CurrencyService::class);
|
||||
|
||||
return [
|
||||
return [
|
||||
/** @var string $id ID */
|
||||
'id' => $this->resource->id,
|
||||
/** @var string $name Name */
|
||||
|
||||
@@ -14,6 +14,7 @@ use App\Models\Report;
|
||||
use App\Models\Tag;
|
||||
use App\Models\Task;
|
||||
use App\Models\TimeEntry;
|
||||
use App\Service\CurrencyService;
|
||||
use App\Service\Dto\ReportPropertiesDto;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\Unit\Endpoint\Api\V1\ApiEndpointTestAbstract;
|
||||
@@ -104,6 +105,8 @@ class PublicReportEndpointTest extends ApiEndpointTestAbstract
|
||||
TimeEntry::factory()->forOrganization($organization)->forTask($task2)->startWithDuration(now()->subDay(), 100)->create();
|
||||
TimeEntry::factory()->forOrganization($organization)->startWithDuration(now()->subDay(), 100)->create();
|
||||
|
||||
$currencyService = app(CurrencyService::class);
|
||||
|
||||
// Act
|
||||
$response = $this->getJson(route('api.v1.public.reports.show'), [
|
||||
'X-Api-Key' => $report->share_secret,
|
||||
@@ -116,6 +119,12 @@ class PublicReportEndpointTest extends ApiEndpointTestAbstract
|
||||
'description' => $report->description,
|
||||
'public_until' => $report->public_until?->toIso8601ZuluString(),
|
||||
'currency' => $organization->currency,
|
||||
'number_format' => $organization->number_format,
|
||||
'interval_format' => $organization->interval_format,
|
||||
'currency_format' => $organization->currency_format,
|
||||
'currency_symbol' => $currencyService->getCurrencySymbol($organization->currency),
|
||||
'time_format' => $organization->time_format,
|
||||
'date_format' => $organization->date_format,
|
||||
'properties' => [
|
||||
'group' => $reportDto->group->value,
|
||||
'sub_group' => $reportDto->subGroup->value,
|
||||
|
||||
Reference in New Issue
Block a user