test: allow image fallback rerenders

This commit is contained in:
Erwan Leboucher committed 2026-08-20 12:18:02 +02:00
1 parent 7cb1e4a3e8
commit 3f54503269
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,
])
);
});