Release Sign in with QR out of labs (#10066)
This commit is contained in:
parent
477de46814
commit
5123d7e641
9 changed files with 12 additions and 66 deletions
|
@ -21,8 +21,6 @@ import React from "react";
|
|||
|
||||
import LoginWithQRSection from "../../../../../src/components/views/settings/devices/LoginWithQRSection";
|
||||
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
|
||||
import { SettingLevel } from "../../../../../src/settings/SettingLevel";
|
||||
import SettingsStore from "../../../../../src/settings/SettingsStore";
|
||||
|
||||
function makeClient() {
|
||||
return mocked({
|
||||
|
@ -67,22 +65,14 @@ describe("<LoginWithQRSection />", () => {
|
|||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("feature enabled", async () => {
|
||||
await SettingsStore.setValue("feature_qr_signin_reciprocate_show", null, SettingLevel.DEVICE, true);
|
||||
const { container } = render(getComponent());
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("only feature + MSC3882 enabled", async () => {
|
||||
await SettingsStore.setValue("feature_qr_signin_reciprocate_show", null, SettingLevel.DEVICE, true);
|
||||
it("only MSC3882 enabled", async () => {
|
||||
const { container } = render(getComponent({ versions: makeVersions({ "org.matrix.msc3882": true }) }));
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("should render panel", () => {
|
||||
it("enabled by feature + MSC3882 + MSC3886", async () => {
|
||||
await SettingsStore.setValue("feature_qr_signin_reciprocate_show", null, SettingLevel.DEVICE, true);
|
||||
it("MSC3882 + MSC3886", async () => {
|
||||
const { container } = render(
|
||||
getComponent({
|
||||
versions: makeVersions({
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<LoginWithQRSection /> should not render feature enabled 1`] = `<div />`;
|
||||
|
||||
exports[`<LoginWithQRSection /> should not render no support at all 1`] = `<div />`;
|
||||
|
||||
exports[`<LoginWithQRSection /> should not render only feature + MSC3882 enabled 1`] = `<div />`;
|
||||
exports[`<LoginWithQRSection /> should not render only MSC3882 enabled 1`] = `<div />`;
|
||||
|
||||
exports[`<LoginWithQRSection /> should render panel enabled by feature + MSC3882 + MSC3886 1`] = `
|
||||
exports[`<LoginWithQRSection /> should render panel MSC3882 + MSC3886 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="mx_SettingsSubsection"
|
||||
|
|
|
@ -79,17 +79,7 @@ describe("<SecurityUserSettingsTab />", () => {
|
|||
expect(queryByTestId("devices-section")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("does not render qr code login section when disabled", () => {
|
||||
settingsValueSpy.mockReturnValue(false);
|
||||
const { queryByText } = render(getComponent());
|
||||
|
||||
expect(settingsValueSpy).toHaveBeenCalledWith("feature_qr_signin_reciprocate_show");
|
||||
|
||||
expect(queryByText("Sign in with QR code")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("renders qr code login section when enabled", async () => {
|
||||
settingsValueSpy.mockImplementation((settingName) => settingName === "feature_qr_signin_reciprocate_show");
|
||||
it("renders qr code login section", async () => {
|
||||
const { getByText } = render(getComponent());
|
||||
|
||||
// wait for versions call to settle
|
||||
|
@ -99,7 +89,6 @@ describe("<SecurityUserSettingsTab />", () => {
|
|||
});
|
||||
|
||||
it("enters qr code login section when show QR code button clicked", async () => {
|
||||
settingsValueSpy.mockImplementation((settingName) => settingName === "feature_qr_signin_reciprocate_show");
|
||||
const { getByText, getByTestId } = render(getComponent());
|
||||
// wait for versions call to settle
|
||||
await flushPromises();
|
||||
|
|
|
@ -1351,17 +1351,7 @@ describe("<SessionManagerTab />", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("does not render qr code login section when disabled", () => {
|
||||
settingsValueSpy.mockReturnValue(false);
|
||||
const { queryByText } = render(getComponent());
|
||||
|
||||
expect(settingsValueSpy).toHaveBeenCalledWith("feature_qr_signin_reciprocate_show");
|
||||
|
||||
expect(queryByText("Sign in with QR code")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("renders qr code login section when enabled", async () => {
|
||||
settingsValueSpy.mockImplementation((settingName) => settingName === "feature_qr_signin_reciprocate_show");
|
||||
it("renders qr code login section", async () => {
|
||||
const { getByText } = render(getComponent());
|
||||
|
||||
// wait for versions call to settle
|
||||
|
@ -1371,7 +1361,6 @@ describe("<SessionManagerTab />", () => {
|
|||
});
|
||||
|
||||
it("enters qr code login section when show QR code button clicked", async () => {
|
||||
settingsValueSpy.mockImplementation((settingName) => settingName === "feature_qr_signin_reciprocate_show");
|
||||
const { getByText, getByTestId } = render(getComponent());
|
||||
// wait for versions call to settle
|
||||
await flushPromises();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue