Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 4, 2024
1 parent 4e9118e commit 32a8eb5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions selfservice/strategy/password/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ func TestSettings(t *testing.T) {
values.Set("method", "password")
values.Set("password", x.NewUUID().String())
actual, res := testhelpers.SettingsMakeRequest(t, true, false, f, apiUser2, testhelpers.EncodeFormAsJSON(t, true, values))
assert.Equal(t, http.StatusBadRequest, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "ui.messages.0.text").String(), "initiated by another person", "%s", actual)
assert.Equal(t, http.StatusForbidden, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "error.reason").String(), "initiated by another person", "%s", actual)
})

t.Run("type=spa", func(t *testing.T) {
Expand All @@ -212,8 +212,8 @@ func TestSettings(t *testing.T) {
values.Set("method", "password")
values.Set("password", x.NewUUID().String())
actual, res := testhelpers.SettingsMakeRequest(t, false, true, f, browserUser2, values.Encode())
assert.Equal(t, http.StatusBadRequest, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "ui.messages.0.text").String(), "initiated by another person", "%s", actual)
assert.Equal(t, http.StatusForbidden, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "error.reason").String(), "initiated by another person", "%s", actual)
})

t.Run("type=browser", func(t *testing.T) {
Expand All @@ -222,8 +222,8 @@ func TestSettings(t *testing.T) {
values.Set("method", "password")
values.Set("password", x.NewUUID().String())
actual, res := testhelpers.SettingsMakeRequest(t, false, false, f, browserUser2, values.Encode())
assert.Equal(t, http.StatusOK, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "ui.messages.0.text").String(), "initiated by another person", "%s", actual)
assert.Equal(t, http.StatusForbidden, res.StatusCode)
assert.Contains(t, gjson.Get(actual, "error.reason").String(), "initiated by another person", "%s", actual)
})
})

Expand Down

0 comments on commit 32a8eb5

Please sign in to comment.