Apply strictNullChecks to src/components/views/location/* (#10249

* strict fixes

* accessiblebutton without onClick explicit

* strict fix for UserMenu BaseAvatar
This commit is contained in:
Kerry 2023-02-28 21:55:59 +13:00 committed by GitHub
parent 6de8d85f7e
commit dd6fc124d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 46 additions and 31 deletions

View file

@ -33,6 +33,7 @@ import { LocationShareType } from "../../../../src/components/views/location/sha
import {
flushPromisesWithFakeTimers,
getMockClientWithEventEmitter,
mockClientMethodsUser,
setupAsyncStoreWithClient,
} from "../../../test-utils";
import Modal from "../../../../src/Modal";
@ -74,7 +75,7 @@ jest.mock("../../../../src/Modal", () => ({
describe("<LocationShareMenu />", () => {
const userId = "@ernie:server.org";
const mockClient = getMockClientWithEventEmitter({
getUserId: jest.fn().mockReturnValue(userId),
...mockClientMethodsUser(userId),
getClientWellKnown: jest.fn().mockResolvedValue({
map_style_url: "maps.com",
}),
@ -334,7 +335,7 @@ describe("<LocationShareMenu />", () => {
expect(SettingsStore.setValue).toHaveBeenCalledWith(
"feature_location_share_live",
undefined,
null,
SettingLevel.DEVICE,
true,
);

View file

@ -48,6 +48,7 @@ jest.mock("../../../../src/customisations/helpers/UIComponents", () => ({
describe("<SpacePanel />", () => {
const mockClient = {
getUserId: jest.fn().mockReturnValue("@test:test"),
getSafeUserId: jest.fn().mockReturnValue("@test:test"),
isGuest: jest.fn(),
getAccountData: jest.fn(),
} as unknown as MatrixClient;