diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index fa8c7dd30e..74e006354b 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -194,7 +194,12 @@ export default createReactClass({ let e2eeSection; if (!this.state.isPublic && SettingsStore.getValue("feature_cross_signing")) { e2eeSection = - +

{ _t("You can’t disable this later. Bridges & most bots won’t work yet.") }

; } diff --git a/src/components/views/elements/LabelledToggleSwitch.js b/src/components/views/elements/LabelledToggleSwitch.js index ecd4d39bf8..78beb2aa91 100644 --- a/src/components/views/elements/LabelledToggleSwitch.js +++ b/src/components/views/elements/LabelledToggleSwitch.js @@ -35,6 +35,9 @@ export default class LabelledToggleSwitch extends React.Component { // True to put the toggle in front of the label // Default false. toggleInFront: PropTypes.bool, + + // Additional class names to append to the switch. Optional. + className: PropTypes.string, }; render() { @@ -50,8 +53,9 @@ export default class LabelledToggleSwitch extends React.Component { secondPart = temp; } + const classes = `mx_SettingsFlag ${this.props.className || ""}`; return ( -
+
{firstPart} {secondPart}
diff --git a/test/end-to-end-tests/src/usecases/create-room.js b/test/end-to-end-tests/src/usecases/create-room.js index 140748bca7..ab2d9b69b9 100644 --- a/test/end-to-end-tests/src/usecases/create-room.js +++ b/test/end-to-end-tests/src/usecases/create-room.js @@ -20,7 +20,7 @@ async function openRoomDirectory(session) { await roomDirectoryButton.click(); } -async function createRoom(session, roomName) { +async function createRoom(session, roomName, encrypted=false) { session.log.step(`creates room "${roomName}"`); const roomListHeaders = await session.queryAll('.mx_RoomSubList_labelContainer'); @@ -33,10 +33,14 @@ async function createRoom(session, roomName) { const addRoomButton = await roomsHeader.$(".mx_RoomSubList_addRoom"); await addRoomButton.click(); - const roomNameInput = await session.query('.mx_CreateRoomDialog_name input'); await session.replaceInputText(roomNameInput, roomName); + if (!encrypted) { + const encryptionToggle = await session.query('.mx_CreateRoomDialog_e2eSwitch .mx_ToggleSwitch'); + await encryptionToggle.click(); + } + const createButton = await session.query('.mx_Dialog_primary'); await createButton.click();