From d2faa4ab4d5c19fabecf91c7c9550101e4098d94 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Tue, 10 Sep 2024 08:03:15 +0800 Subject: [PATCH 1/5] change changePassword data data structure --- tests/csapi/account_change_password_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/csapi/account_change_password_test.go b/tests/csapi/account_change_password_test.go index efd8ecb0..551b9ebb 100644 --- a/tests/csapi/account_change_password_test.go +++ b/tests/csapi/account_change_password_test.go @@ -108,8 +108,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, From a1872c74c4c65e13212e90bdfbf638c37e9d4798 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Thu, 12 Sep 2024 05:10:36 +0800 Subject: [PATCH 2/5] fix: Use latest data struce for acccount testing --- tests/csapi/account_change_password_test.go | 7 +++++-- tests/csapi/account_deactivate_test.go | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/csapi/account_change_password_test.go b/tests/csapi/account_change_password_test.go index 551b9ebb..671a686f 100644 --- a/tests/csapi/account_change_password_test.go +++ b/tests/csapi/account_change_password_test.go @@ -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", diff --git a/tests/csapi/account_deactivate_test.go b/tests/csapi/account_deactivate_test.go index b8a82ccb..5d1d67cd 100644 --- a/tests/csapi/account_deactivate_test.go +++ b/tests/csapi/account_deactivate_test.go @@ -95,7 +95,10 @@ func TestDeactivateAccount(t *testing.T) { reqBody := client.WithJSONBody(t, map[string]interface{}{ "identifier": map[string]interface{}{ "type": "m.id.user", - "user": authedClient.UserID, + "identifier": map[string]interface{}{ + "type": "m.id.user", + "user": authedClient.UserID, + }, }, "type": "m.login.password", "password": password, @@ -111,8 +114,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, }, }) From 19c0a8af5fa31e2d84d976ce503aa058caf83e1a Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Fri, 13 Sep 2024 07:50:36 +0800 Subject: [PATCH 3/5] f --- tests/csapi/apidoc_room_create_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/csapi/apidoc_room_create_test.go b/tests/csapi/apidoc_room_create_test.go index 2fea3dbc..d9cd9ccf 100644 --- a/tests/csapi/apidoc_room_create_test.go +++ b/tests/csapi/apidoc_room_create_test.go @@ -118,7 +118,7 @@ func TestRoomCreate(t *testing.T) { res := alice.CreateRoom(t, map[string]interface{}{ "visibility": "private", - "room_version": 1, + "room_version": "1", "preset": "public_chat", }) must.MatchResponse(t, res, match.HTTPResponse{ From f972453bc6a508fce38f906b23f7466f849c9979 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Fri, 13 Sep 2024 09:42:38 +0800 Subject: [PATCH 4/5] fix --- tests/csapi/account_deactivate_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/csapi/account_deactivate_test.go b/tests/csapi/account_deactivate_test.go index 5d1d67cd..9b2eaaa8 100644 --- a/tests/csapi/account_deactivate_test.go +++ b/tests/csapi/account_deactivate_test.go @@ -95,10 +95,7 @@ func TestDeactivateAccount(t *testing.T) { reqBody := client.WithJSONBody(t, map[string]interface{}{ "identifier": map[string]interface{}{ "type": "m.id.user", - "identifier": map[string]interface{}{ - "type": "m.id.user", - "user": authedClient.UserID, - }, + "user": authedClient.UserID, }, "type": "m.login.password", "password": password, From 64c8d9e64fa51c4ecbce6be12ca65dce8acc9701 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Sat, 14 Sep 2024 22:26:18 +0800 Subject: [PATCH 5/5] wip --- tests/csapi/apidoc_room_create_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/csapi/apidoc_room_create_test.go b/tests/csapi/apidoc_room_create_test.go index d9cd9ccf..2fea3dbc 100644 --- a/tests/csapi/apidoc_room_create_test.go +++ b/tests/csapi/apidoc_room_create_test.go @@ -118,7 +118,7 @@ func TestRoomCreate(t *testing.T) { res := alice.CreateRoom(t, map[string]interface{}{ "visibility": "private", - "room_version": "1", + "room_version": 1, "preset": "public_chat", }) must.MatchResponse(t, res, match.HTTPResponse{