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:
parent
90817f3bc6
commit
6ab235f10c
7 changed files with 40 additions and 0 deletions
|
@ -116,6 +116,7 @@ describe('MessagePanel', function() {
|
|||
getAvatarUrl: () => {
|
||||
return "avatar.jpeg";
|
||||
},
|
||||
getMxcAvatarUrl: () => 'mxc://avatar.url/image.png',
|
||||
},
|
||||
ts: ts0 + i*1000,
|
||||
mship: 'join',
|
||||
|
@ -148,6 +149,7 @@ describe('MessagePanel', function() {
|
|||
getAvatarUrl: () => {
|
||||
return "avatar.jpeg";
|
||||
},
|
||||
getMxcAvatarUrl: () => 'mxc://avatar.url/image.png',
|
||||
},
|
||||
ts: ts0 + i*1000,
|
||||
mship: 'join',
|
||||
|
@ -193,6 +195,7 @@ describe('MessagePanel', function() {
|
|||
getAvatarUrl: () => {
|
||||
return "avatar.jpeg";
|
||||
},
|
||||
getMxcAvatarUrl: () => 'mxc://avatar.url/image.png',
|
||||
},
|
||||
ts: ts0 + 1,
|
||||
mship: 'join',
|
||||
|
@ -239,6 +242,7 @@ describe('MessagePanel', function() {
|
|||
getAvatarUrl: () => {
|
||||
return "avatar.jpeg";
|
||||
},
|
||||
getMxcAvatarUrl: () => 'mxc://avatar.url/image.png',
|
||||
},
|
||||
ts: ts0 + 5,
|
||||
mship: 'invite',
|
||||
|
|
|
@ -50,6 +50,7 @@ describe('MemberEventListSummary', function() {
|
|||
getAvatarUrl: () => {
|
||||
return "avatar.jpeg";
|
||||
},
|
||||
getMxcAvatarUrl: () => 'mxc://avatar.url/image.png',
|
||||
},
|
||||
});
|
||||
// Override random event ID to allow for equality tests against tiles from
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue