matrix-user-swap/tests/input/leave.json5
Olivia Lee af38c51b24
add test for recording alias on a no-op room that is left
Currently we have a bug where we don't record the alias, because that
happens in plan_room and then plan is discarded as empty.
2024-12-22 01:37:19 -08:00

70 lines
2 KiB
Text

// When enabling the "leave" setting, the old user should leave all rooms
// that are fully migrated. In this test case, all rooms can be fully migrated.
{
"settings": {
"leave": true
},
"rooms": {
// A room that the new user will be invited to and join
"!join:example.com": [
{
"type": "m.room.member",
"state_key": "@old:example.com",
"content": {
"membership": "join"
}
}
],
// A room that the new user is already in, so nothing should happen
// except for the old user leaving.
"!room1:example.com": [
{
"type": "m.room.member",
"state_key": "@old:example.com",
"content": {
"membership": "join"
}
},
{
"type": "m.room.member",
"state_key": "@new:example.com",
"content": {
"membership": "join"
}
}
],
// Same as the last case, but we have an alias that we should record
// even though we didn't plan anything other than leaving.
"!no-op-with-alias:example.com": [
{
"type": "m.room.member",
"state_key": "@old:example.com",
"content": {
"membership": "join"
}
},
{
"type": "m.room.member",
"state_key": "@new:example.com",
"content": {
"membership": "join"
}
},
{
"type": "m.room.canonical_alias",
"state_key": "",
"content": {
"alias": "#alias:example.com"
}
}
]
},
"old_user": {
"user_id": "@old:example.com"
},
"new_user": {
"user_id": "@new:example.com"
}
}