Skip to content

Commit 03d43ce

Browse files
committed
tests: Fixup tests for state event encryption lab.
1 parent e7104b7 commit 03d43ce

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

test/test-utils/test-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export function createTestClient(): MatrixClient {
123123
getDeviceVerificationStatus: jest.fn(),
124124
resetKeyBackup: jest.fn(),
125125
isEncryptionEnabledInRoom: jest.fn().mockResolvedValue(false),
126+
isStateEncryptionEnabledInRoom: jest.fn().mockResolvedValue(false),
126127
getVerificationRequestsToDeviceInProgress: jest.fn().mockReturnValue([]),
127128
setDeviceIsolationMode: jest.fn(),
128129
prepareToEncrypt: jest.fn(),

test/unit-tests/components/views/dialogs/CreateRoomDialog-test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ describe("<CreateRoomDialog />", () => {
202202
name: roomName,
203203
},
204204
encryption: true,
205+
stateEncryption: false,
205206
parentSpace: undefined,
206207
roomType: undefined,
207208
});
@@ -263,6 +264,7 @@ describe("<CreateRoomDialog />", () => {
263264
visibility: Visibility.Private,
264265
},
265266
encryption: true,
267+
stateEncryption: false,
266268
joinRule: JoinRule.Knock,
267269
parentSpace: undefined,
268270
roomType: undefined,
@@ -281,6 +283,7 @@ describe("<CreateRoomDialog />", () => {
281283
visibility: Visibility.Public,
282284
},
283285
encryption: true,
286+
stateEncryption: false,
284287
joinRule: JoinRule.Knock,
285288
parentSpace: undefined,
286289
roomType: undefined,

test/unit-tests/components/views/dialogs/__snapshots__/CreateRoomDialog-test.tsx.snap

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,34 @@ exports[`<CreateRoomDialog /> for a private room should render not the advanced
313313
<p>
314314
You can't disable this later. Bridges & most bots won't work yet.
315315
</p>
316+
<div
317+
class="mx_SettingsFlag mx_CreateRoomDialog_e2eSwitch"
318+
>
319+
<span
320+
class="mx_SettingsFlag_label"
321+
>
322+
<div
323+
id="mx_LabelledToggleSwitch_«r55»"
324+
>
325+
Encrypt state events
326+
</div>
327+
</span>
328+
<div
329+
aria-checked="false"
330+
aria-disabled="false"
331+
aria-labelledby="mx_LabelledToggleSwitch_«r55»"
332+
class="mx_AccessibleButton mx_ToggleSwitch mx_ToggleSwitch_enabled"
333+
role="switch"
334+
tabindex="0"
335+
>
336+
<div
337+
class="mx_ToggleSwitch_ball"
338+
/>
339+
</div>
340+
</div>
341+
<p>
342+
Enables experimental support for encrypting state events, which hides metadata such as room names and topics from being visible to the server.
343+
</p>
316344
</div>
317345
</form>
318346
<div

0 commit comments

Comments
 (0)