11import { APIRequestContext , expect , Page } from '@playwright/test' ;
22import { getIssueFrame , setupIssueMock } from 'e2e/helpers' ;
3+ import { JiraTypes } from 'e2e/helpers/types' ;
34import { AtlascodeDrawer , AtlassianSettings } from 'e2e/page-objects' ;
45
56const LABELS_FIELD_PLACEHOLDER = 'Type to search' ;
67const LABEL = 'testing' ;
78
8- export async function updateLabelsFlow ( page : Page , request : APIRequestContext ) {
9+ export async function updateLabelsFlow ( page : Page , request : APIRequestContext , type : JiraTypes ) {
910 await new AtlassianSettings ( page ) . closeSettingsPage ( ) ;
1011
1112 await new AtlascodeDrawer ( page ) . jira . openIssue ( 'BTS-1 - User Interface Bugs' ) ;
@@ -29,15 +30,15 @@ export async function updateLabelsFlow(page: Page, request: APIRequestContext) {
2930 // Check the label option is visible and contains the label
3031 await expect ( labelOption ) . toBeVisible ( ) ;
3132
32- const cleanupIssueMock = await setupIssueMock ( request , { labels : [ LABEL ] } ) ;
33+ const cleanupIssueMock = await setupIssueMock ( request , { labels : [ LABEL ] } , 'GET' , type ) ;
3334
3435 await labelOption . click ( ) ;
3536 await page . waitForTimeout ( 1000 ) ;
3637
3738 // Check the updated label field
3839 await expect ( issueFrame . getByText ( LABEL , { exact : true } ) ) . toBeVisible ( ) ;
3940
40- const cleanupIssueMock2 = await setupIssueMock ( request , { labels : [ LABEL ] } , 'PUT' ) ;
41+ const cleanupIssueMock2 = await setupIssueMock ( request , { labels : [ LABEL ] } , 'PUT' , type ) ;
4142
4243 // Label remove button
4344 await issueFrame . locator ( '.ac-select__multi-value__remove' ) . click ( ) ;
0 commit comments