Ensure sub-issues get proper labels when moved to by parent. (#5714) (#5816)

Signed-off-by: ada mandala <ada.mandala@pm.me>
This commit is contained in:
Ada Mandala 2024-06-14 00:35:55 -05:00 committed by GitHub
parent dda0446a73
commit 1ce1eecf16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 1 deletions

View File

@ -569,6 +569,7 @@ async function updateIssuesOnMove (
},
true
)
const number = (incResult as any).object.sequence
await updateIssuesOnMove(
client,
applyOps,
@ -577,7 +578,8 @@ async function updateIssuesOnMove (
{
...updates.get(attached._id as Ref<Issue>),
rank: makeRank(lastOne?.rank, undefined),
number: (incResult as any).object.sequence
number,
identifier: `${space.identifier}-${number}`
},
updates
)

View File

@ -12,6 +12,7 @@ export class IssuesDetailsPage extends CommonTrackerPage {
readonly inputTitle = (): Locator => this.page.locator('div.popupPanel-body input[type="text"]')
readonly inputDescription = (): Locator => this.page.locator('div.popupPanel-body div.textInput div.tiptap')
readonly textIdentifier = (): Locator => this.page.locator('div.title.not-active')
readonly buttonStatus = (): Locator => this.page.locator('//span[text()="Status"]/../button[1]//span')
readonly buttonPriority = (): Locator => this.page.locator('//span[text()="Priority"]/../button[2]//span')
readonly buttonAssignee = (): Locator => this.page.locator('(//span[text()="Assignee"]/../div/button)[2]')

View File

@ -161,4 +161,32 @@ test.describe('Tracker sub-issues tests', () => {
parentIssue: parentIssue.title
})
})
test('Sub-issues move with parent issue', async ({ page }) => {
const secondProjectName = 'Second Project'
const newIssue: NewIssue = {
title: `Issue for the sub-issue-${generateId()}`,
description: 'Description Issue for the sub-issue'
}
const newSubIssue: NewIssue = {
title: `New Sub-Issue with parameter-${generateId()}`,
description: 'New Description Sub-Issue with parameter'
}
await leftSideMenuPage.clickTracker()
await issuesPage.clickModelSelectorAll()
await issuesPage.createNewIssue(newIssue)
await issuesPage.searchIssueByName(newIssue.title)
await issuesPage.openIssueByName(newIssue.title)
await issuesDetailsPage.clickButtonAddSubIssue()
await issuesPage.fillNewIssueForm(newSubIssue)
await issuesPage.clickButtonCreateIssue()
await issuesDetailsPage.moreActionOnIssue('Move to project')
await issuesDetailsPage.fillMoveIssuesModal(secondProjectName)
await issuesDetailsPage.openSubIssueByName(newSubIssue.title)
await expect(issuesDetailsPage.textIdentifier()).toHaveText(/SECON-\d+/)
})
})