Skip to content

Commit 81111fb

Browse files
committed
fix: flake
1 parent dced9ba commit 81111fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,10 @@ func (s *MethodTestSuite) TestTemplate() {
12671267
check.Args(tv.ID).Asserts(t1, policy.ActionRead).Returns(tv)
12681268
}))
12691269
s.Run("Orphaned/GetTemplateVersionByID", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) {
1270-
tv := testutil.Fake(s.T(), faker, database.TemplateVersion{TemplateID: uuid.NullUUID{Valid: false}})
1270+
tv := testutil.Fake(s.T(), faker, database.TemplateVersion{})
1271+
// uuid.NullUUID{Valid: false} is a zero value. faker overwrites zero values
1272+
// with random data, so we need to set TemplateID after faker is done with it.
1273+
tv.TemplateID = uuid.NullUUID{Valid: false}
12711274
dbm.EXPECT().GetTemplateVersionByID(gomock.Any(), tv.ID).Return(tv, nil).AnyTimes()
12721275
check.Args(tv.ID).Asserts(tv.RBACObjectNoTemplate(), policy.ActionRead).Returns(tv)
12731276
}))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy