Skip to content

Commit

Permalink
fix: Use latest data structure for acccount testing (#735)
Browse files Browse the repository at this point in the history
* change changePassword data data structure

* fix: Use latest data struce for acccount testing

* f

* fix

* wip
  • Loading branch information
chrislearn authored Sep 26, 2024
1 parent 247f7fe commit c246a09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
14 changes: 10 additions & 4 deletions tests/csapi/account_change_password_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ func TestChangePassword(t *testing.T) {
_, sessionOptional := createSession(t, deployment, passwordClient.UserID, password2)
reqBody := client.WithJSONBody(t, map[string]interface{}{
"auth": map[string]interface{}{
"type": "m.login.password",
"user": passwordClient.UserID,
"type": "m.login.password",
"identifier": map[string]interface{}{
"type": "m.id.user",
"user": passwordClient.UserID,
},
"password": password2,
},
"new_password": "new_optional_password",
Expand All @@ -108,8 +111,11 @@ func changePassword(t *testing.T, passwordClient *client.CSAPI, oldPassword stri
t.Helper()
reqBody := client.WithJSONBody(t, map[string]interface{}{
"auth": map[string]interface{}{
"type": "m.login.password",
"user": passwordClient.UserID,
"type": "m.login.password",
"identifier": map[string]interface{}{
"type": "m.id.user",
"user": passwordClient.UserID,
},
"password": oldPassword,
},
"new_password": newPassword,
Expand Down
7 changes: 5 additions & 2 deletions tests/csapi/account_deactivate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ func deactivateAccount(t *testing.T, authedClient *client.CSAPI, password string
t.Helper()
reqBody := client.WithJSONBody(t, map[string]interface{}{
"auth": map[string]interface{}{
"type": "m.login.password",
"user": authedClient.UserID,
"type": "m.login.password",
"identifier": map[string]interface{}{
"type": "m.id.user",
"user": authedClient.UserID,
},
"password": password,
},
})
Expand Down

0 comments on commit c246a09

Please sign in to comment.