diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..9e579c0a7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1792773339, + "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..35bbb1ecb --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "My example flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: { + devShells.x86_64-linux = { + default = + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in + pkgs.mkShell { + packages = with pkgs; [ go ]; + }; + }; + }; +} diff --git a/tests/csapi/apidoc_room_state_test.go b/tests/csapi/apidoc_room_state_test.go index ff085efc3..5291e97de 100644 --- a/tests/csapi/apidoc_room_state_test.go +++ b/tests/csapi/apidoc_room_state_test.go @@ -87,6 +87,13 @@ func TestRoomState(t *testing.T) { // sytest: GET /rooms/:room_id/joined_members fetches my membership t.Run("GET /rooms/:room_id/joined_members fetches my membership", func(t *testing.T) { t.Parallel() + + avatarURL := "mxc://example.com/SEsfnsuifSDFSSEF" + reqBody := client.WithJSONBody(t, map[string]interface{}{ + "avatar_url": avatarURL, + }) + authedClient.MustDo(t, "PUT", []string{"_matrix", "client", "v3", "profile", authedClient.UserID, "avatar_url"}, reqBody) + roomID := authedClient.MustCreateRoom(t, map[string]interface{}{ "visibility": "public", "preset": "public_chat", @@ -97,8 +104,8 @@ func TestRoomState(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent("joined"), match.JSONKeyPresent("joined." + authedClient.UserID), - match.JSONKeyPresent("joined." + authedClient.UserID + ".display_name"), - match.JSONKeyPresent("joined." + authedClient.UserID + ".avatar_url"), + match.JSONKeyTypeEqual("joined."+authedClient.UserID+".display_name", gjson.String), + match.JSONKeyEqual("joined."+authedClient.UserID+".avatar_url", avatarURL), }, }) })