Force enable threads labs flag
This commit is contained in:
parent
fbfa174ad0
commit
7ca1b385d9
27 changed files with 41 additions and 40 deletions
|
@ -172,7 +172,7 @@ describe("TimelinePanel", () => {
|
|||
const getValueCopy = SettingsStore.getValue;
|
||||
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
|
||||
if (name === "sendReadReceipts") return true;
|
||||
if (name === "feature_threadstable") return false;
|
||||
if (name === "feature_threadenabled") return false;
|
||||
return getValueCopy(name);
|
||||
});
|
||||
|
||||
|
@ -186,7 +186,7 @@ describe("TimelinePanel", () => {
|
|||
const getValueCopy = SettingsStore.getValue;
|
||||
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
|
||||
if (name === "sendReadReceipts") return false;
|
||||
if (name === "feature_threadstable") return false;
|
||||
if (name === "feature_threadenabled") return false;
|
||||
return getValueCopy(name);
|
||||
});
|
||||
|
||||
|
@ -363,7 +363,7 @@ describe("TimelinePanel", () => {
|
|||
client.supportsExperimentalThreads = () => true;
|
||||
const getValueCopy = SettingsStore.getValue;
|
||||
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
|
||||
if (name === "feature_threadstable") return true;
|
||||
if (name === "feature_threadenabled") return true;
|
||||
return getValueCopy(name);
|
||||
});
|
||||
|
||||
|
@ -518,7 +518,7 @@ describe("TimelinePanel", () => {
|
|||
});
|
||||
|
||||
it("renders when the last message is an undecryptable thread root", async () => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadstable");
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadenabled");
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
client.isRoomEncrypted = () => true;
|
||||
|
|
|
@ -389,7 +389,7 @@ describe("<MessageActionBar />", () => {
|
|||
describe("when threads feature is not enabled", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation(
|
||||
(setting) => setting !== "feature_threadstable",
|
||||
(setting) => setting !== "feature_threadenabled",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -435,7 +435,7 @@ describe("<MessageActionBar />", () => {
|
|||
describe("when threads feature is enabled", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation(
|
||||
(setting) => setting === "feature_threadstable",
|
||||
(setting) => setting === "feature_threadenabled",
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ describe("RoomHeaderButtons-test.tsx", function () {
|
|||
});
|
||||
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string) => {
|
||||
if (name === "feature_threadstable") return true;
|
||||
if (name === "feature_threadenabled") return true;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ describe("EventTile", () => {
|
|||
|
||||
jest.spyOn(client, "getRoom").mockReturnValue(room);
|
||||
jest.spyOn(client, "decryptEventIfNeeded").mockResolvedValue();
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadstable");
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadenabled");
|
||||
|
||||
mxEvent = mkMessage({
|
||||
room: room.roomId,
|
||||
|
|
|
@ -30,7 +30,7 @@ import { fireEvent, getByTestId, render, screen, waitFor } from "@testing-librar
|
|||
import Notifications from "../../../../src/components/views/settings/Notifications";
|
||||
import SettingsStore from "../../../../src/settings/SettingsStore";
|
||||
import { StandardActions } from "../../../../src/notifications/StandardActions";
|
||||
import { getMockClientWithEventEmitter, mkMessage } from "../../../test-utils";
|
||||
import { getMockClientWithEventEmitter, mkMessage, mockClientMethodsUser } from "../../../test-utils";
|
||||
|
||||
// don't pollute test output with error logs from mock rejections
|
||||
jest.mock("matrix-js-sdk/src/logger");
|
||||
|
@ -205,6 +205,7 @@ describe("<Notifications />", () => {
|
|||
};
|
||||
|
||||
const mockClient = getMockClientWithEventEmitter({
|
||||
...mockClientMethodsUser(),
|
||||
getPushRules: jest.fn(),
|
||||
getPushers: jest.fn(),
|
||||
getThreePids: jest.fn(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue