add frontend format support for currencies, add currencies endpoint

This commit is contained in:
Gregor Vostrak
2025-05-08 17:25:36 +02:00
parent 8b950d99d6
commit ed32c6b217
24 changed files with 352 additions and 128 deletions

View File

@@ -1,7 +1,8 @@
import { expect, Page } from '@playwright/test';
import { PLAYWRIGHT_BASE_URL } from '../playwright/config';
import { test } from '../playwright/fixtures';
import { formatCents } from '../resources/js/packages/ui/src/utils/money';
import { formatCents, getOrganizationCurrencySymbol } from '../resources/js/packages/ui/src/utils/money';
import type { CurrencyFormat } from '../resources/js/packages/ui/src/utils/money';
async function goToProjectsOverview(page: Page) {
await page.goto(PLAYWRIGHT_BASE_URL + '/projects');
@@ -61,6 +62,12 @@ test('test that updating project member billable rate works for existing time en
page
.getByRole('row')
.first()
.getByText(formatCents(newBillableRate * 100, 'EUR'))
.getByText(formatCents(
newBillableRate * 100,
'EUR',
'symbol-before' as CurrencyFormat,
'€',
'space-point'
))
).toBeVisible();
});

View File

@@ -1,7 +1,8 @@
import { expect, Page } from '@playwright/test';
import { PLAYWRIGHT_BASE_URL } from '../playwright/config';
import { test } from '../playwright/fixtures';
import { formatCents } from '../resources/js/packages/ui/src/utils/money';
import { formatCents, getOrganizationCurrencySymbol } from '../resources/js/packages/ui/src/utils/money';
import type { CurrencyFormat } from '../resources/js/packages/ui/src/utils/money';
async function goToProjectsOverview(page: Page) {
await page.goto(PLAYWRIGHT_BASE_URL + '/projects');
@@ -131,7 +132,13 @@ test('test that updating billable rate works with existing time entries', async
page
.getByRole('row')
.first()
.getByText(formatCents(newBillableRate * 100, 'EUR'))
.getByText(formatCents(
newBillableRate * 100,
'EUR',
'symbol-before' as CurrencyFormat,
'€',
'space-point'
))
).toBeVisible();
});