Merge pull request #1802 from Molecule-AI/fix/main-orgtoken-mocks

fix(orgtoken): restore flexible LIMIT regex in TestList_NewestFirst
This commit is contained in:
Hongming Wang 2026-04-23 12:04:51 -07:00 committed by GitHub
commit 7cd9ad1959
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,7 +145,7 @@ func TestList_NewestFirst(t *testing.T) {
now := time.Now()
earlier := now.Add(-1 * time.Hour)
mock.ExpectQuery(`SELECT id, prefix.*FROM org_api_tokens.*ORDER BY created_at DESC`).
mock.ExpectQuery(`SELECT id, prefix.*FROM org_api_tokens.*ORDER BY created_at DESC( LIMIT $1)?`).
WithArgs(listMax).
WillReturnRows(sqlmock.NewRows([]string{"id", "prefix", "name", "org_id", "created_by", "created_at", "last_used_at"}).
AddRow("t2", "abcd1234", "zapier", "org-1", "user_01", now, now).