mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-04 15:52:24 -08:00
test: allow image fallback rerenders
This commit is contained in:
1 file changed
+5
-7
@@ -286,18 +286,16 @@ describe('ImageContent', () => {
|
||||
600,
|
||||
'scale'
|
||||
);
|
||||
const originalRequestCount = vi
|
||||
.mocked(mxcUrlToHttp)
|
||||
.mock.calls.filter((call) => call.length === 3).length;
|
||||
|
||||
Object.defineProperty(img, 'naturalWidth', { value: 800, configurable: true });
|
||||
Object.defineProperty(img, 'naturalHeight', { value: 600, configurable: true });
|
||||
fireEvent.load(img);
|
||||
|
||||
await waitFor(() =>
|
||||
expect(vi.mocked(mxcUrlToHttp).mock.calls.filter((call) => call.length === 3)).toHaveLength(
|
||||
originalRequestCount + 1
|
||||
)
|
||||
expect(vi.mocked(mxcUrlToHttp).mock.calls.at(-1)).toEqual([
|
||||
{},
|
||||
'mxc://example.org/abc123',
|
||||
false,
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user