-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLOUDTRUST-2298] Add api_self_account_editing_enabled and show_profi…
…le_tab to realm configuration
- Loading branch information
Showing
3 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package configuration | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestNewRealmConfiguration(t *testing.T) { | ||
t.Run("Invalid JSON", func(t *testing.T) { | ||
var _, err = NewRealmConfiguration(`{`) | ||
assert.NotNil(t, err) | ||
}) | ||
t.Run("Has deprecated field, new field not set", func(t *testing.T) { | ||
var conf, _ = NewRealmConfiguration(`{"api_self_mail_editing_enabled":true}`) | ||
assert.Nil(t, conf.DeprecatedAPISelfMailEditingEnabled) | ||
assert.True(t, *conf.APISelfAccountEditingEnabled) | ||
}) | ||
t.Run("Has deprecated field, new field already set", func(t *testing.T) { | ||
var conf, _ = NewRealmConfiguration(`{"api_self_mail_editing_enabled":true, "api_self_account_editing_enabled":false}`) | ||
assert.Nil(t, conf.DeprecatedAPISelfMailEditingEnabled) | ||
assert.False(t, *conf.APISelfAccountEditingEnabled) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters