From 0db3fe3ba67d5596a3a20043286945a3fe147931 Mon Sep 17 00:00:00 2001 From: tobi Date: Mon, 17 Mar 2025 14:29:29 +0100 Subject: [PATCH] add errnorows test --- internal/db/bundb/application_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/db/bundb/application_test.go b/internal/db/bundb/application_test.go index a5160dbe2..540c632b5 100644 --- a/internal/db/bundb/application_test.go +++ b/internal/db/bundb/application_test.go @@ -143,6 +143,17 @@ func (suite *ApplicationTestSuite) TestDeleteTokensByClientID() { } } +func (suite *ApplicationTestSuite) TestDeleteTokensByUnknownClientID() { + // Should not return ErrNoRows even though + // the client with given ID doesn't exist. + if err := suite.state.DB.DeleteTokensByClientID( + context.Background(), + "01JPJ4NCGH6GHY7ZVYBHNP55XS", + ); err != nil { + suite.FailNow(err.Error()) + } +} + func TestApplicationTestSuite(t *testing.T) { suite.Run(t, new(ApplicationTestSuite)) }