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

Commit

Permalink
Adds Space, WorkItemType, Tracker dependency in TrackerQuery test (#2399
Browse files Browse the repository at this point in the history
)
  • Loading branch information
DhritiShikhar authored Jan 21, 2019
1 parent a9703fb commit e553514
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions controller/trackerquery_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (s *TestTrackerQueryREST) TestUnauthorizeTrackerQueryCUD() {
func (s *TestTrackerQueryREST) TestCreateTrackerQuery() {
resource.Require(s.T(), resource.Database)

fxt := tf.NewTestFixture(s.T(), s.DB, tf.Spaces(1), tf.Trackers(1), tf.WorkItemTypes(1), tf.TrackerQueries(1))
fxt := tf.NewTestFixture(s.T(), s.DB, tf.TrackerQueries(1))
assert.NotNil(s.T(), fxt.Spaces[0], fxt.Trackers[0], fxt.TrackerQueries[0])

s.T().Run("nil WIT in trackerquery payload", func(t *testing.T) {
Expand Down Expand Up @@ -196,7 +196,7 @@ func (s *TestTrackerQueryREST) TestCreateTrackerQuery() {
func (s *TestTrackerQueryREST) TestShowTrackerQuery() {
resource.Require(s.T(), resource.Database)

fxt := tf.NewTestFixture(s.T(), s.DB, tf.Spaces(1), tf.Trackers(1), tf.WorkItemTypes(1), tf.TrackerQueries(1))
fxt := tf.NewTestFixture(s.T(), s.DB, tf.TrackerQueries(1))
assert.NotNil(s.T(), fxt.Spaces[0], fxt.Trackers[0], fxt.TrackerQueries[0])

_, tqr := test.ShowTrackerqueryOK(s.T(), s.svc.Context, s.svc, s.trackerqueryCtrl, fxt.TrackerQueries[0].ID)
Expand All @@ -209,7 +209,7 @@ func (s *TestTrackerQueryREST) TestShowTrackerQuery() {
func (s *TestTrackerQueryREST) TestCreateTrackerQueryID() {
resource.Require(s.T(), resource.Database)

fxt := tf.NewTestFixture(s.T(), s.DB, tf.Spaces(1), tf.Trackers(1), tf.WorkItemTypes(1), tf.TrackerQueries(1))
fxt := tf.NewTestFixture(s.T(), s.DB, tf.TrackerQueries(1))

s.T().Run("valid - success", func(t *testing.T) {
_, result := test.ShowTrackerqueryOK(t, s.svc.Context, s.svc, s.trackerqueryCtrl, fxt.TrackerQueries[0].ID)
Expand Down Expand Up @@ -256,7 +256,7 @@ func newCreateTrackerQueryPayload(spaceID uuid.UUID, trackerID uuid.UUID, witID
func (s *TestTrackerQueryREST) TestDeleteTrackerQuery() {
resource.Require(s.T(), resource.Database)

fxt := tf.NewTestFixture(s.T(), s.DB, tf.Spaces(1), tf.Trackers(1), tf.WorkItemTypes(1), tf.TrackerQueries(1))
fxt := tf.NewTestFixture(s.T(), s.DB, tf.TrackerQueries(1))
assert.NotNil(s.T(), fxt.Spaces[0], fxt.Trackers[0], fxt.TrackerQueries[0])

s.T().Run("delete trackerquery - success", func(t *testing.T) {
Expand All @@ -276,9 +276,6 @@ func (s *TestTrackerQueryREST) TestDeleteTrackerQuery() {

s.T().Run("delete remoteworkitems - true", func(t *testing.T) {
fxt := tf.NewTestFixture(s.T(), s.DB,
tf.Spaces(1),
tf.WorkItemTypes(1),
tf.Trackers(1),
tf.TrackerQueries(2),
tf.WorkItems(3, func(fxt *tf.TestFixture, idx int) error {
switch idx {
Expand Down Expand Up @@ -311,9 +308,6 @@ func (s *TestTrackerQueryREST) TestDeleteTrackerQuery() {

s.T().Run("delete remoteworkitems - false", func(t *testing.T) {
fxt := tf.NewTestFixture(s.T(), s.DB,
tf.Spaces(1),
tf.WorkItemTypes(1),
tf.Trackers(1),
tf.TrackerQueries(2),
tf.WorkItems(3, func(fxt *tf.TestFixture, idx int) error {
switch idx {
Expand Down
2 changes: 1 addition & 1 deletion test/testfixture/recipe_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func TrackerQueries(n int, fns ...CustomizeTrackerQueriesFunc) RecipeFunction {
if err := fxt.setupInfo(n, kindTrackerQueries, customFuncs...); err != nil {
return err
}
return fxt.deps()
return fxt.deps(Spaces(1), WorkItemTypes(1), Trackers(1))
}
}

Expand Down

0 comments on commit e553514

Please sign in to comment.