Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 1338a6d

Browse files
committed
Change settings to true by default
1 parent ccb1a61 commit 1338a6d

File tree

9 files changed

+5
-25
lines changed

9 files changed

+5
-25
lines changed

playwright/e2e/pinned-messages/pinned-messages.spec.ts

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import { test } from "./index";
1010
import { expect } from "../../element-web-test";
1111

1212
test.describe("Pinned messages", () => {
13-
test.use({
14-
labsFlags: ["feature_pinning"],
15-
});
16-
1713
test("should show the empty state when there are no pinned messages", async ({ page, app, room1, util }) => {
1814
await util.goTo(room1);
1915
await util.openRoomInfo();
Loading
Loading
Loading
Loading

src/settings/Settings.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export const SETTINGS: { [setting: string]: ISetting } = {
280280
displayName: _td("labs|pinning"),
281281
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
282282
supportedLevelsAreOrdered: true,
283-
default: false,
283+
default: true,
284284
},
285285
"feature_wysiwyg_composer": {
286286
isFeature: true,

test/components/views/context_menus/MessageContextMenu-test.tsx

-16
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,6 @@ describe("MessageContextMenu", () => {
116116
expect(screen.queryByRole("menuitem", { name: "Pin" })).toBeFalsy();
117117
});
118118

119-
it("does not show pin option when pinning feature is disabled", () => {
120-
const eventContent = createMessageEventContent("hello");
121-
const pinnableEvent = new MatrixEvent({
122-
type: EventType.RoomMessage,
123-
content: eventContent,
124-
room_id: roomId,
125-
});
126-
127-
// disable pinning feature
128-
jest.spyOn(SettingsStore, "getValue").mockReturnValue(false);
129-
130-
createMenu(pinnableEvent, { rightClick: true }, {}, undefined, room);
131-
132-
expect(screen.queryByRole("menuitem", { name: "Pin" })).toBeFalsy();
133-
});
134-
135119
it("shows pin option when pinning feature is enabled", () => {
136120
const eventContent = createMessageEventContent("hello");
137121
const pinnableEvent = new MatrixEvent({

test/components/views/rooms/PinnedEventTile-test.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import dis from "../../../../src/dispatcher/dispatcher";
1919
import { Action } from "../../../../src/dispatcher/actions";
2020
import { getForwardableEvent } from "../../../../src/events";
2121
import { createRedactEventDialog } from "../../../../src/components/views/dialogs/ConfirmRedactDialog";
22-
import SettingsStore from "../../../../src/settings/SettingsStore.ts";
2322

2423
jest.mock("../../../../src/components/views/dialogs/ConfirmRedactDialog", () => ({
2524
createRedactEventDialog: jest.fn(),
@@ -38,8 +37,6 @@ describe("<PinnedEventTile />", () => {
3837
permalinkCreator = new RoomPermalinkCreator(room);
3938
mockClient.getRoom = jest.fn().mockReturnValue(room);
4039
jest.spyOn(dis, "dispatch").mockReturnValue(undefined);
41-
// Enable feature_pinning
42-
jest.spyOn(SettingsStore, "getValue").mockReturnValue(true);
4340
});
4441

4542
/**

test/test-utils/test-utils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,10 @@ export function mkStubRoom(
571571
name: string | undefined,
572572
client: MatrixClient | undefined,
573573
): Room {
574-
const stubTimeline = { getEvents: (): MatrixEvent[] => [] } as unknown as EventTimeline;
574+
const stubTimeline = {
575+
getEvents: (): MatrixEvent[] => [],
576+
getState: (): RoomState | undefined => undefined,
577+
} as unknown as EventTimeline;
575578
return {
576579
canInvite: jest.fn(),
577580
client,

0 commit comments

Comments
 (0)