Skip to content

Commit e600b7d

Browse files
committed
fix some tests
1 parent 892388a commit e600b7d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

coderd/database/dbauthz/dbauthz_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -4532,7 +4532,14 @@ func (s *MethodTestSuite) TestSystemFunctions() {
45324532
check.Args(true).Asserts(rbac.ResourceDeploymentConfig, policy.ActionUpdate)
45334533
}))
45344534
s.Run("GetNotificationVAPIDKeys", s.Subtest(func(db database.Store, check *expects) {
4535-
check.Args().Asserts(rbac.ResourceDeploymentConfig, policy.ActionRead).Errors(sql.ErrNoRows)
4535+
require.NoError(s.T(), db.UpsertNotificationVAPIDKeys(context.Background(), database.UpsertNotificationVAPIDKeysParams{
4536+
VapidPublicKey: "test",
4537+
VapidPrivateKey: "test",
4538+
}))
4539+
check.Args().Asserts(rbac.ResourceDeploymentConfig, policy.ActionRead).Returns(database.GetNotificationVAPIDKeysRow{
4540+
VapidPublicKey: "test",
4541+
VapidPrivateKey: "test",
4542+
})
45364543
}))
45374544
s.Run("UpsertNotificationVAPIDKeys", s.Subtest(func(db database.Store, check *expects) {
45384545
check.Args(database.UpsertNotificationVAPIDKeysParams{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- VAPID keys lited from coderd/notifications_test.go.
2+
INSERT INTO notification_push_subscriptions (id, user_id, created_at, endpoint, endpoint_p256dh_key, endpoint_auth_key) VALUES (gen_random_uuid(), (SELECT id FROM users LIMIT 1), NOW(), 'https://example.com', 'BNNL5ZaTfK81qhXOx23+wewhigUeFb632jN6LvRWCFH1ubQr77FE/9qV1FuojuRmHP42zmf34rXgW80OvUVDgTk=', 'zqbxT6JKstKSY9JKibZLSQ==');

0 commit comments

Comments
 (0)