diff --git a/plugins/tracker-resources/src/components/issues/timereport/ReportedTimeEditor.svelte b/plugins/tracker-resources/src/components/issues/timereport/ReportedTimeEditor.svelte
index c972eb8878..31c475d3bc 100644
--- a/plugins/tracker-resources/src/components/issues/timereport/ReportedTimeEditor.svelte
+++ b/plugins/tracker-resources/src/components/issues/timereport/ReportedTimeEditor.svelte
@@ -44,7 +44,7 @@
{#if kind === 'link'}
-
+
{#if value !== undefined}
{floorFractionDigits(value, 2)}
diff --git a/plugins/tracker-resources/src/components/issues/timereport/ReportsPopup.svelte b/plugins/tracker-resources/src/components/issues/timereport/ReportsPopup.svelte
index fa4a83912f..570c9bea2d 100644
--- a/plugins/tracker-resources/src/components/issues/timereport/ReportsPopup.svelte
+++ b/plugins/tracker-resources/src/components/issues/timereport/ReportsPopup.svelte
@@ -77,6 +77,6 @@
-
+
diff --git a/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReport.svelte b/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReport.svelte
index 24365a65ee..803b52e784 100644
--- a/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReport.svelte
+++ b/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReport.svelte
@@ -50,6 +50,7 @@
{#if value && value.value}
{
await page.keyboard.press('Escape')
await expect(page.locator('.antiPanel-component')).not.toContainText(name)
})
+
+test('report-time-from-issue-card', async ({ page }) => {
+ await navigate(page)
+ const assignee = 'Rosamund Chen'
+ const status = 'In Progress'
+ const values = ['0.25', '0.5', '0.75', '1']
+ for (let i = 0; i < 10; i++) {
+ const random = Math.floor(Math.random() * values.length)
+ const time = values[random]
+ const name = getIssueName()
+ await createIssue(page, { name, assignee, status })
+
+ await page.click('text="View issue"')
+
+ await page.click('#ReportedTimeEditor')
+ await page.click('#ReportsPopupAddButton')
+ await expect(page.locator('button:has-text("Create")')).toBeDisabled()
+ await page.fill('[placeholder="Reported\\ time"]', time)
+ await expect(page.locator('button:has-text("Create")')).toBeEnabled()
+ await page.click('button:has-text("Create")')
+ await page.keyboard.press('Escape')
+
+ await expect(page.locator('#TimeSpendReportValue')).toContainText(`${time}d`)
+ }
+})
+
+test('report-time-from-main-view', async ({ page }) => {
+ await navigate(page)
+
+ await page.click('text="Issues"')
+ await page.click('button:has-text("View")')
+ await page.click('text="Status" >> nth=1')
+ await page.click('text="Last updated"')
+ await page.keyboard.press('Escape')
+
+ const values = [0.25, 0.5, 0.75, 1]
+ const assignee = 'Rosamund Chen'
+ const status = 'In Progress'
+ for (let i = 0; i < 5; i++) {
+ const name = getIssueName()
+ await createIssue(page, { name, assignee, status })
+ await page.waitForSelector(`text="${name}"`)
+ await page.click('.close-button >> button')
+
+ let count = 0
+ for (let i = 0; i < 5; i++) {
+ const random = Math.floor(Math.random() * values.length)
+ const time = values[random]
+ count += time
+ await page.click('.estimation-container')
+ await page.waitForSelector('text="Estimation"')
+
+ await page.click('text="Add time report"')
+ await expect(page.locator('button:has-text("Create")')).toBeDisabled()
+ await page.fill('[placeholder="Reported\\ time"]', `${time}`)
+ await expect(page.locator('button:has-text("Create")')).toBeEnabled()
+ await page.click('button:has-text("Create")')
+ await page.keyboard.press('Escape')
+
+ await expect(page.locator('.estimation-container >> span').nth(0)).toContainText(`${Number(count.toFixed(2))}d`)
+ }
+ }
+})