diff --git a/cypress/e2e/polls/polls.spec.ts b/cypress/e2e/polls/polls.spec.ts index fd8ad33056..ce0962410c 100644 --- a/cypress/e2e/polls/polls.spec.ts +++ b/cypress/e2e/polls/polls.spec.ts @@ -77,6 +77,7 @@ describe("Polls", () => { }; beforeEach(() => { + cy.enableLabsFeature("feature_threadstable"); cy.window().then((win) => { win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests }); diff --git a/cypress/e2e/threads/threads.spec.ts b/cypress/e2e/threads/threads.spec.ts index 6736df35b1..7b616bd13f 100644 --- a/cypress/e2e/threads/threads.spec.ts +++ b/cypress/e2e/threads/threads.spec.ts @@ -19,10 +19,17 @@ limitations under the License. import { SynapseInstance } from "../../plugins/synapsedocker"; import { MatrixClient } from "../../global"; +function markWindowBeforeReload(): void { + // mark our window object to "know" when it gets reloaded + cy.window().then((w) => (w.beforeReload = true)); +} + describe("Threads", () => { let synapse: SynapseInstance; beforeEach(() => { + // Default threads to ON for this spec + cy.enableLabsFeature("feature_threadstable"); cy.window().then((win) => { win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests }); @@ -37,6 +44,35 @@ describe("Threads", () => { cy.stopSynapse(synapse); }); + it("should reload when enabling threads beta", () => { + markWindowBeforeReload(); + + // Turn off + cy.openUserSettings("Labs").within(() => { + // initially the new property is there + cy.window().should("have.prop", "beforeReload", true); + + cy.leaveBeta("Threaded messages"); + cy.wait(1000); + // after reload the property should be gone + cy.window().should("not.have.prop", "beforeReload"); + }); + + cy.get(".mx_MatrixChat", { timeout: 15000 }); // wait for the app + markWindowBeforeReload(); + + // Turn on + cy.openUserSettings("Labs").within(() => { + // initially the new property is there + cy.window().should("have.prop", "beforeReload", true); + + cy.joinBeta("Threaded messages"); + cy.wait(1000); + // after reload the property should be gone + cy.window().should("not.have.prop", "beforeReload"); + }); + }); + it("should be usable for a conversation", () => { let bot: MatrixClient; cy.getBot(synapse, { diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 3a4a6ef8c3..1ec6b3562f 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -261,7 +261,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { controller: new ThreadBetaController(), displayName: _td("Threaded messages"), supportedLevels: LEVELS_FEATURE, - default: true, + default: false, betaInfo: { title: _td("Threaded messages"), caption: () => (