Skip to content

Commit

Permalink
test: ensure redirect_url in password strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 19, 2021
1 parent efe272f commit 9eafc10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion selfservice/strategy/password/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,15 @@ func TestSettings(t *testing.T) {
actual := testhelpers.SubmitSettingsForm(t, true, false, apiUser1, publicTS, payload,
http.StatusForbidden, publicTS.URL+settings.RouteSubmitFlow)
assertx.EqualAsJSON(t, settings.NewFlowNeedsReAuth(), json.RawMessage(gjson.Get(actual, "error").Raw))
assert.NotEmpty(t, json.RawMessage(gjson.Get(actual, "redirect_browser_to").String()))
})

t.Run("type=spa", func(t *testing.T) {
_ = testhelpers.NewSettingsLoginAcceptAPIServer(t, testhelpers.NewSDKCustomClient(publicTS, browserUser1), conf)
actual := testhelpers.SubmitSettingsForm(t, false, true, browserUser1, publicTS, payload,
http.StatusForbidden, publicTS.URL+settings.RouteSubmitFlow)
assertx.EqualAsJSON(t, settings.NewFlowNeedsReAuth(), json.RawMessage(gjson.Get(actual, "error").Raw))
assertx.EqualAsJSON(t, settings.NewFlowNeedsReAuth().DefaultError, json.RawMessage(gjson.Get(actual, "error").Raw))
assert.NotEmpty(t, json.RawMessage(gjson.Get(actual, "redirect_browser_to").String()))
})

t.Run("type=browser", func(t *testing.T) {
Expand Down

0 comments on commit 9eafc10

Please sign in to comment.