Move ToastContext and utilities to shared components (#33949)
* Move ToastContext and utilities to shared components * lint * fix type * cleanup * fix broken test * fix lint * Add more tests for ToastContext * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
parent
6ce24e2668
commit
0ddc418cf9
@@ -12,10 +12,10 @@ import { type MatrixClient, type UploadResponse } from "matrix-js-sdk/src/matrix
|
||||
import { mocked } from "jest-mock";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
import { ToastContext, type ToastRack } from "@element-hq/web-shared-components";
|
||||
|
||||
import UserProfileSettings from "../../../../../src/components/views/settings/UserProfileSettings";
|
||||
import { mkStubRoom, stubClient } from "../../../../test-utils";
|
||||
import { ToastContext, type ToastRack } from "../../../../../src/contexts/ToastContext";
|
||||
import { OwnProfileStore } from "../../../../../src/stores/OwnProfileStore";
|
||||
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
|
||||
import Modal from "../../../../../src/Modal";
|
||||
@@ -72,7 +72,7 @@ const renderProfileSettings = (toastRack: Partial<ToastRack>, client: MatrixClie
|
||||
return render(
|
||||
<TooltipProvider>
|
||||
<MatrixClientContext.Provider value={client}>
|
||||
<ToastContext.Provider value={toastRack}>
|
||||
<ToastContext.Provider value={toastRack as ToastRack}>
|
||||
<UserProfileSettings canSetAvatar={true} canSetDisplayName={true} />
|
||||
</ToastContext.Provider>
|
||||
</MatrixClientContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user