func (s *WorkItem2Suite) xTestWI2DeleteLinksOnWIDeletionOK() {
	// Create two work items (wi1 and wi2)
	c := minimumRequiredCreatePayload()
	c.Data.Attributes[workitem.SystemTitle] = "WI1"
	c.Data.Attributes[workitem.SystemState] = workitem.SystemStateNew
	c.Data.Relationships.BaseType = newRelationBaseType(space.SystemSpace, workitem.SystemBug)
	_, wi1 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, c.Data.Relationships.Space.Data.ID.String(), &c)
	require.NotNil(s.T(), wi1)
	c.Data.Attributes[workitem.SystemTitle] = "WI2"
	_, wi2 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, c.Data.Relationships.Space.Data.ID.String(), &c)
	require.NotNil(s.T(), wi2)

	// Create link category
	linkCatPayload := CreateWorkItemLinkCategory("test-user")
	_, linkCat := test.CreateWorkItemLinkCategoryCreated(s.T(), s.svc.Context, s.svc, s.linkCatCtrl, linkCatPayload)
	require.NotNil(s.T(), linkCat)

	// Create link space
	spacePayload := CreateSpacePayload("test-space", "description")
	_, space := test.CreateSpaceCreated(s.T(), s.svc.Context, s.svc, s.spaceCtrl, spacePayload)

	// Create work item link type payload
	linkTypePayload := CreateWorkItemLinkType("MyLinkType", workitem.SystemBug, workitem.SystemBug, *linkCat.Data.ID, *space.Data.ID)
	_, linkType := test.CreateWorkItemLinkTypeCreated(s.T(), s.svc.Context, s.svc, s.linkTypeCtrl, space.Data.ID.String(), linkTypePayload)
	require.NotNil(s.T(), linkType)

	// Create link between wi1 and wi2
	id1, err := strconv.ParseUint(*wi1.Data.ID, 10, 64)
	require.Nil(s.T(), err)
	id2, err := strconv.ParseUint(*wi2.Data.ID, 10, 64)
	require.Nil(s.T(), err)
	linkPayload := CreateWorkItemLink(id1, id2, *linkType.Data.ID)
	_, workItemLink := test.CreateWorkItemLinkCreated(s.T(), s.svc.Context, s.svc, s.linkCtrl, linkPayload)
	require.NotNil(s.T(), workItemLink)

	// Delete work item wi1
	test.DeleteWorkitemOK(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, wi1.Data.Relationships.Space.Data.ID.String(), *wi1.Data.ID)

	// Check that the link was deleted by deleting wi1
	test.ShowWorkItemLinkNotFound(s.T(), s.svc.Context, s.svc, s.linkCtrl, *workItemLink.Data.ID)

	// Check that we can query for wi2 without problems
	test.ShowWorkitemOK(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, wi2.Data.Relationships.Space.Data.ID.String(), *wi2.Data.ID, nil, nil)
}
// TestWI2DeleteLinksOnWIDeletionOK creates two work items (WI1 and WI2) and
// creates a link between them. When one of the work items is deleted, the
// link shall be gone as well.
// Temporarly disabled, See https://github.com/almighty/almighty-core/issues/1036
TestWI2DeleteLinksOnWIDeletionOK creates two work items (WI1 and WI2) and
creates a link between them. When one of the work items is deleted, the
link shall be gone as well.
// TestWI2DeleteLinksOnWIDeletionOK creates two work items ( WI1 and WI2 ) and // creates a link between them . When one of the work items is deleted the // link shall be gone as well . // Temporarly disabled See https : // github . com / almighty / almighty - core / issues / 1036
func (s *WorkItem2Suite) xTestWI2DeleteLinksOnWIDeletionOK() {
	c := minimumRequiredCreatePayload()
	c.Data.Attributes[workitem.SystemTitle] = "WI1"
	c.Data.Attributes[workitem.SystemState] = workitem.SystemStateNew
	c.Data.Relationships.BaseType = newRelationBaseType(space.SystemSpace, workitem.SystemBug)
	_, wi1 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, c.Data.Relationships.Space.Data.ID.String(), &c)
	require.NotNil(s.T(), wi1)
	c.Data.Attributes[workitem.SystemTitle] = "WI2"
	_, wi2 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, c.Data.Relationships.Space.Data.ID.String(), &c)
	require.NotNil(s.T(), wi2)
	linkCatPayload := CreateWorkItemLinkCategory("test-user")
	_, linkCat := test.CreateWorkItemLinkCategoryCreated(s.T(), s.svc.Context, s.svc, s.linkCatCtrl, linkCatPayload)
	require.NotNil(s.T(), linkCat)
	spacePayload := CreateSpacePayload("test-space", "description")
	_, space := test.CreateSpaceCreated(s.T(), s.svc.Context, s.svc, s.spaceCtrl, spacePayload)
	linkTypePayload := CreateWorkItemLinkType("MyLinkType", workitem.SystemBug, workitem.SystemBug, *linkCat.Data.ID, *space.Data.ID)
	_, linkType := test.CreateWorkItemLinkTypeCreated(s.T(), s.svc.Context, s.svc, s.linkTypeCtrl, space.Data.ID.String(), linkTypePayload)
	require.NotNil(s.T(), linkType)
	id1, err := strconv.ParseUint(*wi1.Data.ID, 10, 64)
	require.Nil(s.T(), err)
	id2, err := strconv.ParseUint(*wi2.Data.ID, 10, 64)
	require.Nil(s.T(), err)
	linkPayload := CreateWorkItemLink(id1, id2, *linkType.Data.ID)
	_, workItemLink := test.CreateWorkItemLinkCreated(s.T(), s.svc.Context, s.svc, s.linkCtrl, linkPayload)
	require.NotNil(s.T(), workItemLink)
	test.DeleteWorkitemOK(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, wi1.Data.Relationships.Space.Data.ID.String(), *wi1.Data.ID)
	test.ShowWorkItemLinkNotFound(s.T(), s.svc.Context, s.svc, s.linkCtrl, *workItemLink.Data.ID)
	test.ShowWorkitemOK(s.T(), s.svc.Context, s.svc, s.wi2Ctrl, wi2.Data.Relationships.Space.Data.ID.String(), *wi2.Data.ID, nil, nil)
}
func ( s * WorkItem2Suite ) xTestWI2DeleteLinksOnWIDeletionOK ( ) { c := minimumRequiredCreatePayload ( ) c . Data . Attributes [ workitem . SystemTitle ] = " " c . Data . Attributes [ workitem . SystemState ] = workitem . SystemStateNew c . Data . Relationships . BaseType = newRelationBaseType ( space . SystemSpace , workitem . SystemBug ) _ , wi1 := test . CreateWorkitemCreated ( s . T ( ) , s . svc . Context , s . svc , s . wi2Ctrl , c . Data . Relationships . Space . Data . ID . String ( ) , & c ) require . NotNil ( s . T ( ) , wi1 ) c . Data . Attributes [ workitem . SystemTitle ] = " " _ , wi2 := test . CreateWorkitemCreated ( s . T ( ) , s . svc . Context , s . svc , s . wi2Ctrl , c . Data . Relationships . Space . Data . ID . String ( ) , & c ) require . NotNil ( s . T ( ) , wi2 ) linkCatPayload := CreateWorkItemLinkCategory ( " " ) _ , linkCat := test . CreateWorkItemLinkCategoryCreated ( s . T ( ) , s . svc . Context , s . svc , s . linkCatCtrl , linkCatPayload ) require . NotNil ( s . T ( ) , linkCat ) spacePayload := CreateSpacePayload ( " " , " " ) _ , space := test . CreateSpaceCreated ( s . T ( ) , s . svc . Context , s . svc , s . spaceCtrl , spacePayload ) linkTypePayload := CreateWorkItemLinkType ( " " , workitem . SystemBug , workitem . SystemBug , * linkCat . Data . ID , * space . Data . ID ) _ , linkType := test . CreateWorkItemLinkTypeCreated ( s . T ( ) , s . svc . Context , s . svc , s . linkTypeCtrl , space . Data . ID . String ( ) , linkTypePayload ) require . NotNil ( s . T ( ) , linkType ) id1 , err := strconv . ParseUint ( * wi1 . Data . ID , 10 , 64 ) require . Nil ( s . T ( ) , err ) id2 , err := strconv . ParseUint ( * wi2 . Data . ID , 10 , 64 ) require . Nil ( s . T ( ) , err ) linkPayload := CreateWorkItemLink ( id1 , id2 , * linkType . Data . ID ) _ , workItemLink := test . CreateWorkItemLinkCreated ( s . T ( ) , s . svc . Context , s . svc , s . linkCtrl , linkPayload ) require . NotNil ( s . T ( ) , workItemLink ) test . DeleteWorkitemOK ( s . T ( ) , s . svc . Context , s . svc , s . wi2Ctrl , wi1 . Data . Relationships . Space . Data . ID . String ( ) , * wi1 . Data . ID ) test . ShowWorkItemLinkNotFound ( s . T ( ) , s . svc . Context , s . svc , s . linkCtrl , * workItemLink . Data . ID ) test . ShowWorkitemOK ( s . T ( ) , s . svc . Context , s . svc , s . wi2Ctrl , wi2 . Data . Relationships . Space . Data . ID . String ( ) , * wi2 . Data . ID , nil , nil ) }
TestWI2DeleteLinksOnWIDeletionOK creates two work items (WI1 and WI2) and
creates a link between them.
TestWI2DeleteLinksOnWIDeletionOK creates two work items ( WI1 and WI2 ) and creates a link between them .
// Create two work items (wi1 and wi2) // Create link category // Create link space // Create work item link type payload // Create link between wi1 and wi2 // Delete work item wi1 // Check that the link was deleted by deleting wi1 // Check that we can query for wi2 without problems