1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Merge remote-tracking branch 'upstream/develop' into feature/call-event-tile

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-07-20 13:15:04 +02:00
297 changed files with 3248 additions and 2557 deletions

View File

@@ -48,7 +48,7 @@ const button4 = <Button key={4}>d</Button>;
describe("RovingTabIndex", () => {
it("RovingTabIndexProvider renders children as expected", () => {
const wrapper = mount(<RovingTabIndexProvider>
{() => <div><span>Test</span></div>}
{ () => <div><span>Test</span></div> }
</RovingTabIndexProvider>);
expect(wrapper.text()).toBe("Test");
expect(wrapper.html()).toBe('<div><span>Test</span></div>');
@@ -56,11 +56,11 @@ describe("RovingTabIndex", () => {
it("RovingTabIndexProvider works as expected with useRovingTabIndex", () => {
const wrapper = mount(<RovingTabIndexProvider>
{() => <React.Fragment>
{ () => <React.Fragment>
{ button1 }
{ button2 }
{ button3 }
</React.Fragment>}
</React.Fragment> }
</RovingTabIndexProvider>);
// should begin with 0th being active
@@ -98,15 +98,15 @@ describe("RovingTabIndex", () => {
it("RovingTabIndexProvider works as expected with RovingTabIndexWrapper", () => {
const wrapper = mount(<RovingTabIndexProvider>
{() => <React.Fragment>
{ () => <React.Fragment>
{ button1 }
{ button2 }
<RovingTabIndexWrapper>
{({ onFocus, isActive, ref }) =>
{ ({ onFocus, isActive, ref }) =>
<button onFocus={onFocus} tabIndex={isActive ? 0 : -1} ref={ref}>.</button>
}
</RovingTabIndexWrapper>
</React.Fragment>}
</React.Fragment> }
</RovingTabIndexProvider>);
// should begin with 0th being active

View File

@@ -23,6 +23,7 @@ import { mkEvent, mkStubRoom } from "../../../test-utils";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
import * as languageHandler from "../../../../src/languageHandler";
import * as TestUtils from "../../../test-utils";
import DMRoomMap from "../../../../src/utils/DMRoomMap";
const _TextualBody = sdk.getComponent("views.messages.TextualBody");
const TextualBody = TestUtils.wrapInMatrixClientContext(_TextualBody);
@@ -41,6 +42,7 @@ describe("<TextualBody />", () => {
isGuest: () => false,
mxcUrlToHttp: (s) => s,
};
DMRoomMap.makeShared();
const ev = mkEvent({
type: "m.room.message",
@@ -66,6 +68,7 @@ describe("<TextualBody />", () => {
isGuest: () => false,
mxcUrlToHttp: (s) => s,
};
DMRoomMap.makeShared();
const ev = mkEvent({
type: "m.room.message",
@@ -92,6 +95,7 @@ describe("<TextualBody />", () => {
isGuest: () => false,
mxcUrlToHttp: (s) => s,
};
DMRoomMap.makeShared();
});
it("simple message renders as expected", () => {
@@ -146,6 +150,7 @@ describe("<TextualBody />", () => {
isGuest: () => false,
mxcUrlToHttp: (s) => s,
};
DMRoomMap.makeShared();
});
it("italics, bold, underline and strikethrough render as expected", () => {
@@ -292,6 +297,7 @@ describe("<TextualBody />", () => {
isGuest: () => false,
mxcUrlToHttp: (s) => s,
};
DMRoomMap.makeShared();
const ev = mkEvent({
type: "m.room.message",

View File

@@ -1,5 +1,5 @@
import './skinned-sdk'; // Must be first for skinning to work
import { _waitForMember, canEncryptToAllUsers } from '../src/createRoom';
import { waitForMember, canEncryptToAllUsers } from '../src/createRoom';
import { EventEmitter } from 'events';
/* Shorter timeout, we've got tests to run */
@@ -13,7 +13,7 @@ describe("waitForMember", () => {
});
it("resolves with false if the timeout is reached", (done) => {
_waitForMember(client, "", "", { timeout: 0 }).then((r) => {
waitForMember(client, "", "", { timeout: 0 }).then((r) => {
expect(r).toBe(false);
done();
});
@@ -22,7 +22,7 @@ describe("waitForMember", () => {
it("resolves with false if the timeout is reached, even if other RoomState.newMember events fire", (done) => {
const roomId = "!roomId:domain";
const userId = "@clientId:domain";
_waitForMember(client, roomId, userId, { timeout }).then((r) => {
waitForMember(client, roomId, userId, { timeout }).then((r) => {
expect(r).toBe(false);
done();
});
@@ -32,7 +32,7 @@ describe("waitForMember", () => {
it("resolves with true if RoomState.newMember fires", (done) => {
const roomId = "!roomId:domain";
const userId = "@clientId:domain";
_waitForMember(client, roomId, userId, { timeout }).then((r) => {
waitForMember(client, roomId, userId, { timeout }).then((r) => {
expect(r).toBe(true);
expect(client.listeners("RoomState.newMember").length).toBe(0);
done();