func (s *WorkItemSuite) TestReorderWorkitemBottomOK() {
	payload := minimumRequiredCreateWithType(workitem.SystemBug)
	payload.Data.Attributes[workitem.SystemTitle] = "Reorder Test WI"
	payload.Data.Attributes[workitem.SystemState] = workitem.SystemStateClosed

	// There are two workitems in the list -> result1 and result2
	// In this case, we reorder result1 to the bottom of the list i.e. below result2
	test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.controller, payload.Data.Relationships.Space.Data.ID.String(), &payload)
	_, result2 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.controller, payload.Data.Relationships.Space.Data.ID.String(), &payload)
	payload2 := minimumRequiredReorderPayload()

	var dataArray []*app.WorkItem // dataArray contains the workitem(s) that have to be reordered
	dataArray = append(dataArray, result2.Data)
	payload2.Data = dataArray
	payload2.Position.Direction = string(workitem.DirectionBottom)

	_, reordered1 := test.ReorderWorkitemOK(s.T(), s.svc.Context, s.svc, s.controller, space.SystemSpace.String(), &payload2) // Returns the workitems which are reordered

	require.Len(s.T(), reordered1.Data, 1) // checks the correct number of workitems reordered
	assert.Equal(s.T(), result2.Data.Attributes["version"].(int)+1, reordered1.Data[0].Attributes["version"])
	assert.Equal(s.T(), *result2.Data.ID, *reordered1.Data[0].ID)
}
// TestReorderBottom is positive test which tests successful reorder by providing valid input
// This case reorders one workitem -> result1 and places it to the bottom of the list
TestReorderBottom is positive test which tests successful reorder by providing valid input
This case reorders one workitem -> result1 and places it to the bottom of the list
// TestReorderBottom is positive test which tests successful reorder by providing valid input // This case reorders one workitem - > result1 and places it to the bottom of the list
func (s *WorkItemSuite) TestReorderWorkitemBottomOK() {
	payload := minimumRequiredCreateWithType(workitem.SystemBug)
	payload.Data.Attributes[workitem.SystemTitle] = "Reorder Test WI"
	payload.Data.Attributes[workitem.SystemState] = workitem.SystemStateClosed
	test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.controller, payload.Data.Relationships.Space.Data.ID.String(), &payload)
	_, result2 := test.CreateWorkitemCreated(s.T(), s.svc.Context, s.svc, s.controller, payload.Data.Relationships.Space.Data.ID.String(), &payload)
	payload2 := minimumRequiredReorderPayload()
	var dataArray []*app.WorkItem 
	dataArray = append(dataArray, result2.Data)
	payload2.Data = dataArray
	payload2.Position.Direction = string(workitem.DirectionBottom)
	_, reordered1 := test.ReorderWorkitemOK(s.T(), s.svc.Context, s.svc, s.controller, space.SystemSpace.String(), &payload2) 
	require.Len(s.T(), reordered1.Data, 1) 
	assert.Equal(s.T(), result2.Data.Attributes["version"].(int)+1, reordered1.Data[0].Attributes["version"])
	assert.Equal(s.T(), *result2.Data.ID, *reordered1.Data[0].ID)
}
func ( s * WorkItemSuite ) TestReorderWorkitemBottomOK ( ) { payload := minimumRequiredCreateWithType ( workitem . SystemBug ) payload . Data . Attributes [ workitem . SystemTitle ] = " " payload . Data . Attributes [ workitem . SystemState ] = workitem . SystemStateClosed test . CreateWorkitemCreated ( s . T ( ) , s . svc . Context , s . svc , s . controller , payload . Data . Relationships . Space . Data . ID . String ( ) , & payload ) _ , result2 := test . CreateWorkitemCreated ( s . T ( ) , s . svc . Context , s . svc , s . controller , payload . Data . Relationships . Space . Data . ID . String ( ) , & payload ) payload2 := minimumRequiredReorderPayload ( ) var dataArray [ ] * app . WorkItem dataArray = append ( dataArray , result2 . Data ) payload2 . Data = dataArray payload2 . Position . Direction = string ( workitem . DirectionBottom ) _ , reordered1 := test . ReorderWorkitemOK ( s . T ( ) , s . svc . Context , s . svc , s . controller , space . SystemSpace . String ( ) , & payload2 ) require . Len ( s . T ( ) , reordered1 . Data , 1 ) assert . Equal ( s . T ( ) , result2 . Data . Attributes [ " " ] . ( int ) + 1 , reordered1 . Data [ 0 ] . Attributes [ " " ] ) assert . Equal ( s . T ( ) , * result2 . Data . ID , * reordered1 . Data [ 0 ] . ID ) }
TestReorderBottom is positive test which tests successful reorder by providing valid input
This case reorders one workitem -> result1 and places it to the bottom of the list
TestReorderBottom is positive test which tests successful reorder by providing valid input This case reorders one workitem - > result1 and places it to the bottom of the list
// There are two workitems in the list -> result1 and result2 // In this case, we reorder result1 to the bottom of the list i.e. below result2 // dataArray contains the workitem(s) that have to be reordered // Returns the workitems which are reordered // checks the correct number of workitems reordered