mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-05 01:09:37 +00:00
Adds compulsory test coverage, fix tests
This commit is contained in:
@ -107,8 +107,8 @@ func (s *testsuite) TestGetByID() {
|
||||
defer goleak.VerifyNone(s.T(), goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
s.mock.
|
||||
ExpectQuery(regexp.QuoteMeta(`SELECT * FROM "certificate_authority" WHERE "certificate_authority"."id" = $1 AND "certificate_authority"."is_deleted" = $2 ORDER BY "certificate_authority"."id" LIMIT 1`)).
|
||||
WithArgs(10, 0).
|
||||
ExpectQuery(regexp.QuoteMeta(`SELECT * FROM "certificate_authority" WHERE "certificate_authority"."id" = $1 AND "certificate_authority"."is_deleted" = $2 ORDER BY "certificate_authority"."id" LIMIT $3`)).
|
||||
WithArgs(10, 0, 1).
|
||||
WillReturnRows(s.testCA)
|
||||
|
||||
m, err := GetByID(10)
|
||||
@ -127,8 +127,8 @@ func (s *testsuite) TestList() {
|
||||
WillReturnRows(s.listCountRows)
|
||||
|
||||
s.mock.
|
||||
ExpectQuery(regexp.QuoteMeta(`SELECT * FROM "certificate_authority" WHERE name LIKE $1 AND "certificate_authority"."is_deleted" = $2 ORDER BY name asc LIMIT 8`)).
|
||||
WithArgs("%test%", 0).
|
||||
ExpectQuery(regexp.QuoteMeta(`SELECT * FROM "certificate_authority" WHERE name LIKE $1 AND "certificate_authority"."is_deleted" = $2 ORDER BY name asc LIMIT $3`)).
|
||||
WithArgs("%test%", 0, 8).
|
||||
WillReturnRows(s.listRows)
|
||||
|
||||
p := model.PageInfo{
|
||||
|
Reference in New Issue
Block a user