Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Adds tests for delete workitem
Browse files Browse the repository at this point in the history
  • Loading branch information
DhritiShikhar committed Oct 8, 2018
1 parent 55c7af5 commit d8b1cd0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions controller/workitem_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3381,3 +3381,18 @@ func (s *WorkItem2Suite) TestCreateAndUpdateWorkItemForEveryWIT() {
})
}
}

func (s *WorkItem2Suite) TestDeleteWorkitem() {
s.T().Run("ok", func(t *testing.T) {
fxt := tf.NewTestFixture(s.T(), s.DB, tf.WorkItems(1))
s.svc = testsupport.ServiceAsUser("TestUpdateWI2-Service", *fxt.Identities[0])
test.DeleteWorkitemOK(s.T(), s.svc.Context, s.svc, s.workitemCtrl, fxt.WorkItems[0].ID)
})
s.T().Run("unauthorized", func(t *testing.T) {
fxt := tf.NewTestFixture(s.T(), s.DB, tf.WorkItems(1))
test.DeleteWorkitemUnauthorized(s.T(), s.svc.Context, s.svc, s.workitemCtrl, fxt.WorkItems[0].ID)
})
s.T().Run("workitem not found", func(t *testing.T) {
test.DeleteWorkitemNotFound(s.T(), s.svc.Context, s.svc, s.workitemCtrl, uuid.NewV4())
})
}

0 comments on commit d8b1cd0

Please sign in to comment.