@@ -1337,64 +1337,6 @@ describe("Organizations Event Types Endpoints", () => {
13371337
13381338await eventTypesRepositoryFixture . delete ( roundRobinEventType . id ) ;
13391339} ) ;
1340-
1341- it ( "should update managed event type hosts and return array with parent and child event types" , async ( ) => {
1342- const managedEventType = await eventTypesRepositoryFixture . create (
1343- {
1344- title :`managed-update-hosts-${ randomString ( ) } ` ,
1345- slug :`managed-update-hosts-${ randomString ( ) } ` ,
1346- length :60 ,
1347- team :{
1348- connect :{
1349- id :team . id ,
1350- } ,
1351- } ,
1352- schedulingType :"MANAGED" ,
1353- hosts :{
1354- create :[
1355- {
1356- userId :teamMember1 . id ,
1357- isFixed :true ,
1358- } ,
1359- ] ,
1360- } ,
1361- } ,
1362- userAdmin . id
1363- ) ;
1364-
1365- const updateBody = {
1366- hosts :[
1367- {
1368- userId :teamMember2 . id ,
1369- } ,
1370- ] ,
1371- } ;
1372-
1373- const response = await request ( app . getHttpServer ( ) )
1374- . patch ( `/v2/teams/${ team . id } /event-types/${ managedEventType . id } ` )
1375- . send ( updateBody )
1376- . expect ( 200 ) ;
1377-
1378- const responseBody :ApiSuccessResponse < TeamEventTypeOutput_2024_06_14 [ ] > = response . body ;
1379- expect ( responseBody . status ) . toEqual ( SUCCESS_STATUS ) ;
1380- expect ( Array . isArray ( responseBody . data ) ) . toBe ( true ) ;
1381- // note(Lauris): 1 parent managed event type + 1 child event type
1382- expect ( responseBody . data ) . toHaveLength ( 2 ) ;
1383-
1384- const parentEventType = responseBody . data [ 0 ] ;
1385- expect ( parentEventType . schedulingType ) . toEqual ( "managed" ) ;
1386- expect ( parentEventType . hosts ) . toHaveLength ( 1 ) ;
1387- expect ( parentEventType . hosts [ 0 ] . userId ) . toEqual ( teamMember2 . id ) ;
1388- expect ( parentEventType . parentEventTypeId ) . toBeNull ( ) ;
1389-
1390- const childEventType = responseBody . data [ 1 ] ;
1391- expect ( childEventType . parentEventTypeId ) . toEqual ( parentEventType . id ) ;
1392- expect ( childEventType . schedulingType ) . toBeNull ( ) ;
1393- expect ( childEventType . hosts ) . toHaveLength ( 0 ) ;
1394- expect ( childEventType . ownerId ) . toEqual ( teamMember2 . id ) ;
1395-
1396- await eventTypesRepositoryFixture . delete ( managedEventType . id ) ;
1397- } ) ;
13981340} ) ;
13991341
14001342afterAll ( async ( ) => {