1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-06 12:02:40 +03:00

Isolate changes to Thread global into a single describe block (#3390)

This commit is contained in:
Andy Balaam
2023-05-25 12:45:47 +01:00
committed by GitHub
parent c0577c29c4
commit d1bfdca0c9

View File

@@ -206,10 +206,21 @@ describe("EventTimelineSet", () => {
expect(liveTimeline.getEvents().length).toStrictEqual(0); expect(liveTimeline.getEvents().length).toStrictEqual(0);
}); });
describe("When the server supports threads", () => {
let previousThreadHasServerSideSupport: FeatureSupport;
beforeAll(() => {
previousThreadHasServerSideSupport = Thread.hasServerSideSupport;
Thread.hasServerSideSupport = FeatureSupport.Stable;
});
afterAll(() => {
Thread.hasServerSideSupport = previousThreadHasServerSideSupport;
});
it("should allow edits to be added to thread timeline", async () => { it("should allow edits to be added to thread timeline", async () => {
jest.spyOn(client, "supportsThreads").mockReturnValue(true); jest.spyOn(client, "supportsThreads").mockReturnValue(true);
jest.spyOn(client, "getEventMapper").mockReturnValue(eventMapperFor(client, {})); jest.spyOn(client, "getEventMapper").mockReturnValue(eventMapperFor(client, {}));
Thread.hasServerSideSupport = FeatureSupport.Stable;
const sender = "@alice:matrix.org"; const sender = "@alice:matrix.org";
@@ -287,6 +298,7 @@ describe("EventTimelineSet", () => {
expect(lastEvent.getContent().body).toBe(" * edit"); expect(lastEvent.getContent().body).toBe(" * edit");
}); });
}); });
});
describe("non-room timeline", () => { describe("non-room timeline", () => {
it("Adds event to timeline", () => { it("Adds event to timeline", () => {