This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 831
Should open new 1:1 chat room after leaving the old one #9880
Merged
andybalaam
merged 17 commits into
matrix-org:develop
from
nordeck:nic/feat/fix-one-to-one-chat-room
Jan 30, 2023
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d97abd9
should open new 1:1 chat room after leaving the old one
ahmadkadri 073dab1
Merge branch 'matrix-org:develop' into nic/feat/fix-one-to-one-chat-room
ahmadkadri 8650d21
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
ahmadkadri 32df6a6
change the copyright
ahmadkadri f90ec46
Merge branch 'nic/feat/fix-one-to-one-chat-room' of https://github.co…
ahmadkadri 0ac3db1
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 44c8063
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 e13d5cb
update the test
ahmadkadri 6b3136c
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
dhenneke b8e5d99
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 6206d52
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
ahmadkadri 22e0b05
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 125df76
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
ahmadkadri 1aafb15
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
ahmadkadri 0670dfc
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 342b5a1
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
Fox32 56969c5
Merge branch 'develop' into nic/feat/fix-one-to-one-chat-room
dhenneke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
Copyright 2023 Ahmad Kadri | ||
Copyright 2023 Nordeck IT + Consulting GmbH. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { HomeserverInstance } from "../../plugins/utils/homeserver"; | ||
import { Credentials } from "../../support/homeserver"; | ||
|
||
describe("1:1 chat room", () => { | ||
let homeserver: HomeserverInstance; | ||
let user2: Credentials; | ||
|
||
const username = "user1234"; | ||
const password = "p4s5W0rD"; | ||
|
||
beforeEach(() => { | ||
cy.startHomeserver("default").then((data) => { | ||
homeserver = data; | ||
|
||
cy.initTestUser(homeserver, "Jeff"); | ||
cy.registerUser(homeserver, username, password).then((credential) => { | ||
user2 = credential; | ||
cy.visit(`/#/user/${user2.userId}?action=chat`); | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.stopHomeserver(homeserver); | ||
}); | ||
|
||
it("should open new 1:1 chat room after leaving the old one", () => { | ||
// leave 1:1 chat room | ||
cy.contains(".mx_RoomHeader_nametext", username).click(); | ||
cy.contains('[role="menuitem"]', "Leave").click(); | ||
cy.get('[data-testid="dialog-primary-button"]').click(); | ||
|
||
// wait till the room was left | ||
cy.get('[role="group"][aria-label="Historical"]').within(() => { | ||
cy.contains(".mx_RoomTile", username); | ||
}); | ||
|
||
// open new 1:1 chat room | ||
cy.visit(`/#/user/${user2.userId}?action=chat`); | ||
cy.contains(".mx_RoomHeader_nametext", username); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why we consider this assertion to be enough?
I've just checked, and leaving a room does not change its name, it only moves it to the
Historical
section.However this assertion checks the room name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, the old room is not displayed correctly anymore and doesn't show a header where the name would be:
(I can't click "join the discussion" because I am no longer in the room and can't join without being re-invited. Sure the other user then has two rooms, but that's how it is)
So I would assume that the assertion could only be fulfilled when I am in a new 1:1 room that was properly created.
Do you have something in mind on how to improve the assertion?