mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
add report time tests (#2368)
Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
parent
eb2be10adf
commit
bd1079cb53
@ -44,7 +44,7 @@
|
||||
</script>
|
||||
|
||||
{#if kind === 'link'}
|
||||
<div class="link-container flex-between" on:click={showReports}>
|
||||
<div id="ReportedTimeEditor" class="link-container flex-between" on:click={showReports}>
|
||||
{#if value !== undefined}
|
||||
<span class="overflow-label">
|
||||
{floorFractionDigits(value, 2)}
|
||||
|
@ -77,6 +77,6 @@
|
||||
</Scroller>
|
||||
</div>
|
||||
<svelte:fragment slot="buttons">
|
||||
<Button icon={IconAdd} size={'large'} on:click={addReport} />
|
||||
<Button id="ReportsPopupAddButton" icon={IconAdd} size={'large'} on:click={addReport} />
|
||||
</svelte:fragment>
|
||||
</Card>
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
{#if value && value.value}
|
||||
<span
|
||||
id="TimeSpendReportValue"
|
||||
class="issuePresenterRoot flex-row-center"
|
||||
on:click={editSpendReport}
|
||||
use:tooltip={value.employee
|
||||
|
@ -203,3 +203,66 @@ test('my-issues', async ({ page }) => {
|
||||
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`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user