loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at forgejo 32 lines 903 B view raw
1package auth 2 3import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7) 8 9func TestGrantAdditionalScopes(t *testing.T) { 10 tests := []struct { 11 grantScopes string 12 expectedScopes string 13 }{ 14 {"openid profile email", ""}, 15 {"openid profile email groups", ""}, 16 {"openid profile email all", "all"}, 17 {"openid profile email read:user all", "read:user,all"}, 18 {"openid profile email groups read:user", "read:user"}, 19 {"read:user read:repository", "read:user,read:repository"}, 20 {"read:user write:issue public-only", "read:user,write:issue,public-only"}, 21 {"openid profile email read:user", "read:user"}, 22 {"read:invalid_scope", ""}, 23 {"read:invalid_scope,write:scope_invalid,just-plain-wrong", ""}, 24 } 25 26 for _, test := range tests { 27 t.Run(test.grantScopes, func(t *testing.T) { 28 result := grantAdditionalScopes(test.grantScopes) 29 assert.Equal(t, test.expectedScopes, result) 30 }) 31 } 32}