Conform more code to strict null checking (#10169)

* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
This commit is contained in:
Michael Telatynski 2023-02-16 09:38:44 +00:00 committed by GitHub
parent 5123d7e641
commit e8b92b308b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 283 additions and 287 deletions

View file

@ -84,7 +84,7 @@ describe("<BeaconListItem />", () => {
const member = new RoomMember(roomId, aliceId);
member.name = `Alice`;
const room = mockClient.getRoom(roomId);
const room = mockClient.getRoom(roomId)!;
jest.spyOn(room, "getMember").mockReturnValue(member);
return beacons;
@ -185,7 +185,7 @@ describe("<BeaconListItem />", () => {
const { container } = getComponent({ beacon, onClick });
// click the beacon name
fireEvent.click(container.querySelector(".mx_BeaconStatus_description"));
fireEvent.click(container.querySelector(".mx_BeaconStatus_description")!);
expect(onClick).toHaveBeenCalled();
});
});

View file

@ -47,7 +47,7 @@ describe("<ShareLatestLocation />", () => {
const { container, asFragment } = getComponent();
expect(asFragment()).toMatchSnapshot();
fireEvent.click(container.querySelector(".mx_CopyableText_copyButton"));
fireEvent.click(container.querySelector(".mx_CopyableText_copyButton")!);
await flushPromises();
expect(copyPlaintext).toHaveBeenCalledWith("51,42");