Skip to content

Commit

Permalink
Ensure sub-issues get proper labels when moved to by parent. (#5714) (#…
Browse files Browse the repository at this point in the history
…5816)

Signed-off-by: ada mandala <[email protected]>
  • Loading branch information
ada-x64 authored Jun 14, 2024
1 parent dda0446 commit 1ce1eec
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/tracker-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ async function updateIssuesOnMove (
},
true
)
const number = (incResult as any).object.sequence
await updateIssuesOnMove(
client,
applyOps,
Expand All @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions tests/sanity/tests/model/tracker/issues-details-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]')
Expand Down
28 changes: 28 additions & 0 deletions tests/sanity/tests/tracker/subissues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+/)
})
})

0 comments on commit 1ce1eec

Please sign in to comment.