-
-
Notifications
You must be signed in to change notification settings - Fork 816
Should open new 1:1 chat room after leaving the old one #9880
Changes from 3 commits
d97abd9
073dab1
8650d21
32df6a6
f90ec46
0ac3db1
44c8063
e13d5cb
6b3136c
b8e5d99
6206d52
22e0b05
125df76
1aafb15
0670dfc
342b5a1
56969c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
|
||
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 { SynapseInstance } from "../../plugins/synapsedocker"; | ||
import type { Credentials } from "../../support/synapse"; | ||
|
||
describe("1:1 chat room", () => { | ||
let synapse: SynapseInstance; | ||
let user2: Credentials; | ||
|
||
const username = "user1234"; | ||
const password = "p4s5W0rD"; | ||
|
||
beforeEach(() => { | ||
cy.startSynapse("default").then((data) => { | ||
synapse = data; | ||
|
||
cy.initTestUser(synapse, "Jeff"); | ||
cy.registerUser(synapse, username, password).then((credentials) => { | ||
user2 = credentials; | ||
cy.visit(`/#/user/${user2.userId}?action=chat`); | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.stopSynapse(synapse); | ||
}); | ||
|
||
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering why we consider this assertion to be enough? However this assertion checks the room name. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
}); | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.