Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maurice-freitag committed Feb 15, 2022
1 parent 9c0e3f1 commit 44a6298
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion selfservice/flow/login/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func TestFlowLifecycle(t *testing.T) {
})

t.Run("case=redirects with 303", func(t *testing.T) {
c := http.DefaultClient
c := &http.Client{}
// don't get the reference, instead copy the values, so we don't alter the client directly.
*c = *ts.Client()
// prevent the redirect
Expand Down
2 changes: 1 addition & 1 deletion selfservice/flow/recovery/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestInitFlow(t *testing.T) {
})

t.Run("case=redirects with 303", func(t *testing.T) {
c := http.DefaultClient
c := &http.Client{}
// don't get the reference, instead copy the values, so we don't alter the client directly.
*c = *publicTS.Client()
// prevent the redirect
Expand Down
2 changes: 1 addition & 1 deletion selfservice/flow/registration/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestInitFlow(t *testing.T) {
})

t.Run("case=redirects with 303", func(t *testing.T) {
c := http.DefaultClient
c := &http.Client{}
// don't get the reference, instead copy the values, so we don't alter the client directly.
*c = *publicTS.Client()
// prevent the redirect
Expand Down
4 changes: 1 addition & 3 deletions selfservice/flow/settings/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ func TestHandler(t *testing.T) {
})

t.Run("case=redirects with 303", func(t *testing.T) {
c := http.DefaultClient
// don't get the reference, instead copy the values, so we don't alter the client directly.
*c = *publicTS.Client()
c := testhelpers.NewHTTPClientWithArbitrarySessionCookie(t, reg)
// prevent the redirect
c.CheckRedirect = func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
Expand Down
2 changes: 1 addition & 1 deletion selfservice/flow/verification/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestGetFlow(t *testing.T) {
router := x.NewRouterPublic()
ts, _ := testhelpers.NewKratosServerWithRouters(t, reg, router, x.NewRouterAdmin())

c := http.DefaultClient
c := &http.Client{}
// don't get the reference, instead copy the values, so we don't alter the client directly.
*c = *ts.Client()
// prevent the redirect
Expand Down

0 comments on commit 44a6298

Please sign in to comment.