Merge branch 'develop' into sort-imports

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2021-12-09 08:34:20 +00:00
commit 7b94e13a84
642 changed files with 30052 additions and 8035 deletions

View file

@ -70,7 +70,7 @@ describe('ThreadPanel', () => {
wrapper.find(ContextMenuButton).simulate('click');
const found = wrapper.find(ThreadPanelHeaderFilterOptionItem);
expect(found.length).toEqual(2);
const foundButton = found.find('[aria-selected=true]').first();
const foundButton = found.find('[aria-checked=true]').first();
expect(foundButton.text()).toEqual(`${_t("All threads")}${_t('Shows all threads from current room')}`);
expect(foundButton).toMatchSnapshot();
});

View file

@ -8,6 +8,7 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properl
Threads
</span>
<ContextMenuButton
className="mx_ThreadPanel_dropdown"
inputRef={
Object {
"current": null,
@ -29,6 +30,7 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
Threads
</span>
<ContextMenuButton
className="mx_ThreadPanel_dropdown"
inputRef={
Object {
"current": null,
@ -44,21 +46,21 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
exports[`ThreadPanel Header expect that ThreadPanelHeader has the correct option selected in the context menu 1`] = `
<AccessibleButton
aria-selected={true}
aria-checked={true}
className="mx_ThreadPanel_Header_FilterOptionItem"
element="div"
onClick={[Function]}
role="button"
tabIndex={0}
role="menuitemradio"
tabIndex={-1}
>
<div
aria-selected={true}
aria-checked={true}
className="mx_AccessibleButton mx_ThreadPanel_Header_FilterOptionItem"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
role="button"
tabIndex={0}
role="menuitemradio"
tabIndex={-1}
>
<span>
All threads

View file

@ -14,13 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import sdk from '../../../skinned-sdk';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import { createClient } from 'matrix-js-sdk/src/matrix';
import sdk from '../../../skinned-sdk';
import SdkConfig from '../../../../src/SdkConfig';
import { mkServerConfig } from "../../../test-utils";
import { createTestClient, mkServerConfig } from "../../../test-utils";
jest.mock('matrix-js-sdk/src/matrix');
jest.useFakeTimers();
const Registration = sdk.getComponent(
'structures.auth.Registration',
@ -32,6 +37,7 @@ describe('Registration', function() {
beforeEach(function() {
parentDiv = document.createElement('div');
document.body.appendChild(parentDiv);
createClient.mockImplementation(() => createTestClient());
});
afterEach(function() {
@ -49,13 +55,13 @@ describe('Registration', function() {
/>, parentDiv);
}
it('should show server picker', function() {
it('should show server picker', async function() {
const root = render();
const selector = ReactTestUtils.findRenderedDOMComponentWithClass(root, "mx_ServerPicker");
expect(selector).toBeTruthy();
});
it('should show form when custom URLs disabled', function() {
it('should show form when custom URLs disabled', async function() {
jest.spyOn(SdkConfig, "get").mockReturnValue({
disable_custom_urls: true,
});
@ -78,7 +84,7 @@ describe('Registration', function() {
expect(form).toBeTruthy();
});
it("should show SSO options if those are available", () => {
it("should show SSO options if those are available", async () => {
jest.spyOn(SdkConfig, "get").mockReturnValue({
disable_custom_urls: true,
});