fix: sort companies before comparing since map-iteration is not stable
This commit is contained in:
+2
-1
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"sort"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -64,7 +65,7 @@ func TestPrivilegeHandler_Process_UserAdded_And_UserRemoved(t *testing.T) {
|
||||
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
|
||||
return true
|
||||
})
|
||||
|
||||
sort.Strings(companies)
|
||||
assert.Equal(t, []string{"abc-123", "abc-456"}, companies)
|
||||
|
||||
result = handler.Process(&UserRemoved{
|
||||
|
||||
Reference in New Issue
Block a user