Wrap inputs in fieldsets in Space visibility settings (#7350)

* use fieldset in space settings > visibility

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add basic tests for space setttings visibility

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix toggle button placement

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update settings separator color to quinary

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-01-06 11:09:26 +01:00 committed by GitHub
parent 92ee02fe02
commit b1066a5699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 431 additions and 54 deletions

View file

@ -2,6 +2,7 @@ import React from 'react';
import EventEmitter from "events";
import ShallowRenderer from 'react-test-renderer/shallow';
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { JoinRule } from 'matrix-js-sdk/src/@types/partials';
import { MatrixClientPeg as peg } from '../src/MatrixClientPeg';
import dis from '../src/dispatcher/dispatcher';
@ -88,6 +89,7 @@ export function createTestClient() {
setRoomAccountData: jest.fn(),
sendTyping: jest.fn().mockResolvedValue({}),
sendMessage: () => jest.fn().mockResolvedValue({}),
sendStateEvent: jest.fn().mockResolvedValue(),
getSyncState: () => "SYNCING",
generateClientSecret: () => "t35tcl1Ent5ECr3T",
isGuest: () => false,
@ -113,6 +115,7 @@ export function createTestClient() {
registerWithIdentityServer: jest.fn().mockResolvedValue({}),
getIdentityAccount: jest.fn().mockResolvedValue({}),
getTerms: jest.fn().mockResolvedValueOnce(),
doesServerSupportUnstableFeature: jest.fn().mockResolvedValue(),
getPushRules: jest.fn().mockResolvedValue(),
getPushers: jest.fn().mockResolvedValue({ pushers: [] }),
getThreePids: jest.fn().mockResolvedValue({ threepids: [] }),
@ -154,6 +157,7 @@ export function mkEvent(opts) {
"m.room.name", "m.room.topic", "m.room.create", "m.room.join_rules",
"m.room.power_levels", "m.room.topic", "m.room.history_visibility",
"m.room.encryption", "m.room.member", "com.example.state",
"m.room.guest_access",
].indexOf(opts.type) !== -1) {
event.state_key = "";
}
@ -281,6 +285,8 @@ export function mkStubRoom(roomId = null, name, client) {
maySendStateEvent: jest.fn().mockReturnValue(true),
maySendEvent: jest.fn().mockReturnValue(true),
members: [],
getJoinRule: jest.fn().mockReturnValue(JoinRule.Invite),
on: jest.fn(),
},
tags: {},
setBlacklistUnverifiedDevices: jest.fn(),