Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into rav/element-r/shields/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored Sep 5, 2023
2 parents 3062dee + 9eda619 commit beff608
Show file tree
Hide file tree
Showing 112 changed files with 11,736 additions and 9,849 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Run 4 instances in Parallel
runner: [1, 2, 3, 4]
# Naive segmentation of tests
segment: ["a-i", "j-p", "q-s", "t-z"]
steps:
- uses: browser-actions/setup-chrome@c485fa3bab6be59dce18dbc18ef6ab7cbc8ff5f1
- run: echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV
Expand Down Expand Up @@ -172,10 +172,11 @@ jobs:
start: npx serve -p 8080 -L ../webapp
wait-on: "http://localhost:8080"
record: true
parallel: true
parallel: false
command-prefix: "yarn percy exec --parallel --"
config: '{"reporter":"cypress-multi-reporters", "reporterOptions": { "configFile": "cypress-ci-reporter-config.json" } }'
ci-build-id: ${{ needs.prepare.outputs.uuid }}
spec: cypress/e2e/[${{ matrix.segment }}]*/**
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
55 changes: 41 additions & 14 deletions cypress/e2e/read-receipts/high-level.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ describe("Read receipts", () => {
msgtype: content.msgtype,
body: newMessage,
},
"m.relates_to": {
rel_type: "m.replace",
event_id: ev.getId(),
},
};
}
})();
Expand Down Expand Up @@ -688,21 +692,24 @@ describe("Read receipts", () => {
describe("editing messages", () => {
describe("in the main timeline", () => {
// TODO: this passes but we think this should fail, because we think edits should not cause unreads.
it("Editing a message makes a room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Editing a message makes a room unread", () => {
// Given I am not looking at the room
goTo(room1);

receiveMessages(room2, ["Msg1"]);
assertUnread(room2, 1);
markAsRead(room2);
assertRead(room2);

// When an edit appears in the room
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);

// Then it becomes unread
assertUnread(room2, 1);
});
it("Reading an edit makes the room read", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Reading an edit makes the room read", () => {
// Given an edit is making the room unread
goTo(room1);
receiveMessages(room2, ["Msg1"]);
Expand All @@ -723,12 +730,14 @@ describe("Read receipts", () => {
goTo(room1);
assertRead(room2);
});
it("Marking a room as read after an edit makes it read", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Marking a room as read after an edit makes it read", () => {
// Given an edit is makng a room unread
goTo(room1);
receiveMessages(room2, ["Msg1"]);
assertUnread(room2, 1);
markAsRead(room2);
assertRead(room2);
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);
assertUnread(room2, 1);

Expand All @@ -738,20 +747,23 @@ describe("Read receipts", () => {
// Then the room becomes read
assertRead(room2);
});
it("Editing a message after marking as read makes the room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Editing a message after marking as read makes the room unread", () => {
// Given the room is marked as read
goTo(room1);
receiveMessages(room2, ["Msg1"]);
assertUnread(room2, 1);
markAsRead(room2);
assertRead(room2);

// When a message is edited
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);

// Then the room becomes unread
assertUnread(room2, 1);
});
it("Editing a reply after reading it makes the room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Editing a reply after reading it makes the room unread", () => {
// Given the room is all read
goTo(room1);

Expand All @@ -768,25 +780,29 @@ describe("Read receipts", () => {
// Then it becomes unread
assertUnread(room2, 1);
});
it("Editing a reply after marking as read makes the room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Editing a reply after marking as read makes the room unread", () => {
// Given a reply is marked as read
goTo(room1);
receiveMessages(room2, ["Msg1", replyTo("Msg1", "Reply1")]);
assertUnread(room2, 2);
markAsRead(room2);
assertRead(room2);

// When the reply is edited
receiveMessages(room2, [editOf("Reply1", "Reply1 Edit1")]);

// Then the room becomes unread
assertUnread(room2, 1);
});
it("A room with an edit is still unread after restart", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("A room with an edit is still unread after restart", () => {
// Given a message is marked as read
goTo(room1);
receiveMessages(room2, ["Msg1"]);
assertUnread(room2, 1);
markAsRead(room2);
assertRead(room2);

// When an edit appears in the room
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);
Expand All @@ -798,12 +814,14 @@ describe("Read receipts", () => {
saveAndReload();
assertUnread(room2, 1);
});
it("A room where all edits are read is still read after restart", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("A room where all edits are read is still read after restart", () => {
// Given an edit made the room unread
goTo(room1);
receiveMessages(room2, ["Msg1"]);
assertUnread(room2, 1);
markAsRead(room2);
assertRead(room2);
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);
assertUnread(room2, 1);

Expand All @@ -820,7 +838,8 @@ describe("Read receipts", () => {
});

describe("in threads", () => {
it("An edit of a threaded message makes the room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("An edit of a threaded message makes the room unread", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]);
assertUnread(room2, 2);
Expand All @@ -833,7 +852,8 @@ describe("Read receipts", () => {
receiveMessages(room2, [editOf("Resp1", "Edit1")]);
assertUnread(room2, 1);
});
it("Reading an edit of a threaded message makes the room read", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Reading an edit of a threaded message makes the room read", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]);
assertUnread(room2, 2);
Expand All @@ -850,7 +870,8 @@ describe("Read receipts", () => {
openThread("Msg1");
assertRead(room2);
});
it("Marking a room as read after an edit in a thread makes it read", () => {
// XXX: fails because the room is still "bold" even though the notification counts all disappear
it.skip("Marking a room as read after an edit in a thread makes it read", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
assertUnread(room2, 3); // TODO: the edit counts as a message!
Expand All @@ -861,6 +882,7 @@ describe("Read receipts", () => {
// Then it is read
assertRead(room2);
});
// XXX: fails because the room is still "bold" even though the notification counts all disappear
it.skip("Editing a thread message after marking as read makes the room unread", () => {
// Given a room is marked as read
goTo(room1);
Expand All @@ -875,15 +897,17 @@ describe("Read receipts", () => {
// Then the room becomes unread
assertUnread(room2, 1); // TODO: should this edit make us unread?
});
it("A room with an edited threaded message is still unread after restart", () => {
// XXX: fails because on CI the count is 2 instead of 3. Must be a timing issue.
it.skip("A room with an edited threaded message is still unread after restart", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
assertUnread(room2, 3);

saveAndReload();
assertUnread(room2, 3);
});
it("A room where all threaded edits are read is still read after restart", () => {
// XXX: fails because on CI the count is 2 instead of 3. Must be a timing issue.
it.skip("A room where all threaded edits are read is still read after restart", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
assertUnread(room2, 3);
Expand All @@ -897,7 +921,8 @@ describe("Read receipts", () => {
});

describe("thread roots", () => {
it("An edit of a thread root makes the room unread", () => {
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("An edit of a thread root makes the room unread", () => {
goTo(room1);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]);
assertUnread(room2, 2);
Expand Down Expand Up @@ -1171,6 +1196,7 @@ describe("Read receipts", () => {
assertUnread(room2, 2);

markAsRead(room2);
assertRead(room2);

receiveMessages(room2, [customEvent("org.custom.event", { body: "foobar" })]);
assertRead(room2);
Expand All @@ -1182,6 +1208,7 @@ describe("Read receipts", () => {
assertUnread(room2, 2);

markAsRead(room2);
assertRead(room2);

receiveMessages(room2, [customEvent("org.custom.event", { body: "foobar" })]);
assertRead(room2);
Expand Down
4 changes: 3 additions & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ installLogsCollector({
"cons:info",
"cons:warn",
"cons:error",
// "cons:debug",
// most of our logs go through `loglevel`, which sets `logger.log` to be an alias of `logger.debug`.
// Hence, if we want to capture `logger.log` lines, we need to enable `cons:debug` here.
"cons:debug",
"cy:log",
"cy:xhr",
"cy:fetch",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@sentry/browser": "^7.0.0",
"@sentry/tracing": "^7.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@vector-im/compound-design-tokens": "^0.0.4",
"@vector-im/compound-design-tokens": "^0.0.5",
"@vector-im/compound-web": "^0.2.3",
"await-lock": "^2.1.0",
"blurhash": "^1.1.3",
Expand Down
5 changes: 5 additions & 0 deletions res/css/views/dialogs/_CreateRoomDialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ limitations under the License.
font-size: $font-12px;
}
}

.mx_CreateRoomDialog_labelledCheckbox {
color: $muted-fg-color;
margin-top: var(--cpd-space-6x);
}
Loading

0 comments on commit beff608

Please sign in to comment.