You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Fix tests for new call path
We have to mock `fetch` for the caching of the download icon, and then mock out all the function calls used by components to feed a Media object.
This commit is contained in:
@ -37,6 +37,7 @@ describe("<TextualBody />", () => {
|
||||
getRoom: () => mkStubRoom("room_id"),
|
||||
getAccountData: () => undefined,
|
||||
isGuest: () => false,
|
||||
mxcUrlToHttp: (s) => s,
|
||||
};
|
||||
|
||||
const ev = mkEvent({
|
||||
@ -61,6 +62,7 @@ describe("<TextualBody />", () => {
|
||||
getRoom: () => mkStubRoom("room_id"),
|
||||
getAccountData: () => undefined,
|
||||
isGuest: () => false,
|
||||
mxcUrlToHttp: (s) => s,
|
||||
};
|
||||
|
||||
const ev = mkEvent({
|
||||
@ -86,6 +88,7 @@ describe("<TextualBody />", () => {
|
||||
getRoom: () => mkStubRoom("room_id"),
|
||||
getAccountData: () => undefined,
|
||||
isGuest: () => false,
|
||||
mxcUrlToHttp: (s) => s,
|
||||
};
|
||||
});
|
||||
|
||||
@ -139,6 +142,7 @@ describe("<TextualBody />", () => {
|
||||
on: () => undefined,
|
||||
removeListener: () => undefined,
|
||||
isGuest: () => false,
|
||||
mxcUrlToHttp: (s) => s,
|
||||
};
|
||||
});
|
||||
|
||||
@ -284,6 +288,7 @@ describe("<TextualBody />", () => {
|
||||
getAccountData: () => undefined,
|
||||
getUrlPreview: (url) => new Promise(() => {}),
|
||||
isGuest: () => false,
|
||||
mxcUrlToHttp: (s) => s,
|
||||
};
|
||||
|
||||
const ev = mkEvent({
|
||||
|
Reference in New Issue
Block a user