Update to supportsThreads (#9907)
This commit is contained in:
parent
a21929dba0
commit
3e2bf5640e
15 changed files with 16 additions and 20 deletions
|
@ -109,7 +109,7 @@ describe("Notifier", () => {
|
|||
decryptEventIfNeeded: jest.fn(),
|
||||
getRoom: jest.fn(),
|
||||
getPushActionsForEvent: jest.fn(),
|
||||
supportsExperimentalThreads: jest.fn().mockReturnValue(false),
|
||||
supportsThreads: jest.fn().mockReturnValue(false),
|
||||
});
|
||||
|
||||
mockClient.pushRules = {
|
||||
|
|
|
@ -124,7 +124,7 @@ describe("Unread", () => {
|
|||
const myId = client.getUserId()!;
|
||||
|
||||
beforeAll(() => {
|
||||
client.supportsExperimentalThreads = () => true;
|
||||
client.supportsThreads = () => true;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("<RoomSearchView/>", () => {
|
|||
beforeEach(async () => {
|
||||
stubClient();
|
||||
client = MatrixClientPeg.get();
|
||||
client.supportsExperimentalThreads = jest.fn().mockReturnValue(true);
|
||||
client.supportsThreads = jest.fn().mockReturnValue(true);
|
||||
room = new Room("!room:server", client, client.getUserId());
|
||||
mocked(client.getRoom).mockReturnValue(room);
|
||||
permalinkCreator = new RoomPermalinkCreator(room, room.roomId);
|
||||
|
|
|
@ -161,7 +161,7 @@ describe("ThreadPanel", () => {
|
|||
Thread.setServerSideSupport(FeatureSupport.Stable);
|
||||
Thread.setServerSideListSupport(FeatureSupport.Stable);
|
||||
Thread.setServerSideFwdPaginationSupport(FeatureSupport.Stable);
|
||||
jest.spyOn(mockClient, "supportsExperimentalThreads").mockReturnValue(true);
|
||||
jest.spyOn(mockClient, "supportsThreads").mockReturnValue(true);
|
||||
|
||||
room = new Room(ROOM_ID, mockClient, mockClient.getUserId() ?? "", {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
|
|
|
@ -117,7 +117,7 @@ describe("ThreadView", () => {
|
|||
stubClient();
|
||||
mockPlatformPeg();
|
||||
mockClient = mocked(MatrixClientPeg.get());
|
||||
jest.spyOn(mockClient, "supportsExperimentalThreads").mockReturnValue(true);
|
||||
jest.spyOn(mockClient, "supportsThreads").mockReturnValue(true);
|
||||
|
||||
room = new Room(ROOM_ID, mockClient, mockClient.getUserId() ?? "", {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
|
|
|
@ -362,7 +362,7 @@ describe("TimelinePanel", () => {
|
|||
client = MatrixClientPeg.get();
|
||||
|
||||
Thread.hasServerSideSupport = FeatureSupport.Stable;
|
||||
client.supportsExperimentalThreads = () => true;
|
||||
client.supportsThreads = () => true;
|
||||
const getValueCopy = SettingsStore.getValue;
|
||||
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
|
||||
if (name === "feature_threadenabled") return true;
|
||||
|
@ -524,7 +524,7 @@ describe("TimelinePanel", () => {
|
|||
|
||||
const client = MatrixClientPeg.get();
|
||||
client.isRoomEncrypted = () => true;
|
||||
client.supportsExperimentalThreads = () => true;
|
||||
client.supportsThreads = () => true;
|
||||
client.decryptEventIfNeeded = () => Promise.resolve();
|
||||
const authorId = client.getUserId()!;
|
||||
const room = new Room("roomId", client, authorId, {
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("RoomHeaderButtons-test.tsx", function () {
|
|||
|
||||
stubClient();
|
||||
client = MatrixClientPeg.get();
|
||||
client.supportsExperimentalThreads = () => true;
|
||||
client.supportsThreads = () => true;
|
||||
room = new Room(ROOM_ID, client, client.getUserId() ?? "", {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
});
|
||||
|
|
|
@ -92,7 +92,7 @@ describe("EventTile", () => {
|
|||
|
||||
describe("EventTile thread summary", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(client, "supportsExperimentalThreads").mockReturnValue(true);
|
||||
jest.spyOn(client, "supportsThreads").mockReturnValue(true);
|
||||
});
|
||||
|
||||
it("removes the thread summary when thread is deleted", async () => {
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("UnreadNotificationBadge", () => {
|
|||
}
|
||||
|
||||
beforeAll(() => {
|
||||
client.supportsExperimentalThreads = () => true;
|
||||
client.supportsThreads = () => true;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -225,7 +225,7 @@ describe("<Notifications />", () => {
|
|||
}),
|
||||
setAccountData: jest.fn(),
|
||||
sendReadReceipt: jest.fn(),
|
||||
supportsExperimentalThreads: jest.fn().mockReturnValue(true),
|
||||
supportsThreads: jest.fn().mockReturnValue(true),
|
||||
});
|
||||
mockClient.getPushRules.mockResolvedValue(pushRules);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ describe("RoomViewStore", function () {
|
|||
getSafeUserId: jest.fn().mockReturnValue(userId),
|
||||
getDeviceId: jest.fn().mockReturnValue("ABC123"),
|
||||
sendStateEvent: jest.fn().mockResolvedValue({}),
|
||||
supportsExperimentalThreads: jest.fn(),
|
||||
supportsThreads: jest.fn(),
|
||||
});
|
||||
const room = new Room(roomId, mockClient, userId);
|
||||
const room2 = new Room(roomId2, mockClient, userId);
|
||||
|
|
|
@ -166,7 +166,7 @@ export function createTestClient(): MatrixClient {
|
|||
decryptEventIfNeeded: () => Promise.resolve(),
|
||||
isUserIgnored: jest.fn().mockReturnValue(false),
|
||||
getCapabilities: jest.fn().mockResolvedValue({}),
|
||||
supportsExperimentalThreads: () => false,
|
||||
supportsThreads: () => false,
|
||||
getRoomUpgradeHistory: jest.fn().mockReturnValue([]),
|
||||
getOpenIdToken: jest.fn().mockResolvedValue(undefined),
|
||||
registerWithIdentityServer: jest.fn().mockResolvedValue({}),
|
||||
|
|
|
@ -436,7 +436,7 @@ describe("EventUtils", () => {
|
|||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
});
|
||||
|
||||
jest.spyOn(client, "supportsExperimentalThreads").mockReturnValue(true);
|
||||
jest.spyOn(client, "supportsThreads").mockReturnValue(true);
|
||||
jest.spyOn(client, "getRoom").mockReturnValue(room);
|
||||
jest.spyOn(client, "fetchRoomEvent").mockImplementation(async (roomId, eventId) => {
|
||||
return events[eventId] ?? Promise.reject();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue