Hackaton: Add more unit tests, take 3 (#101525)

* serviceaccounts/secretscan: test Service more thoroughly

* middleware/cookies: add tests for CookieOptions

* anonymous/anonimpl: cover a couple more methods

* components/imguploader: Implement WebDAV integration tests

* components/apikeygen: also check IsValid method

* bus: cover invalid callback signature cases

* cloudmigration/objectstorage: add basic unit tests

* login/social/connectors: add test case for GitHub OAuth fetch emails+orgs

* expr/classic: cover more evaluator types in tests
This commit is contained in:
Matheus Macabu
2025-03-05 08:00:12 +01:00
committed by GitHub
parent dc2defd84f
commit 3539764008
9 changed files with 522 additions and 25 deletions
@@ -22,4 +22,8 @@ func TestApiKeyGen(t *testing.T) {
keyHashed, err := util.EncodePassword(keyInfo.Key, keyInfo.Name)
require.NoError(t, err)
assert.Equal(t, result.HashedKey, keyHashed)
valid, err := IsValid(keyInfo, keyHashed)
require.NoError(t, err)
require.True(t, valid)
}