You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
fix tests
This commit is contained in:
@@ -59,6 +59,10 @@ function urlForColor(color) {
|
|||||||
canvas.width = size;
|
canvas.width = size;
|
||||||
canvas.height = size;
|
canvas.height = size;
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
// bail out when using jsdom in unit tests
|
||||||
|
if (!ctx) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
ctx.fillStyle = color;
|
ctx.fillStyle = color;
|
||||||
ctx.fillRect(0, 0, size, size);
|
ctx.fillRect(0, 0, size, size);
|
||||||
return canvas.toDataURL();
|
return canvas.toDataURL();
|
||||||
|
|||||||
Reference in New Issue
Block a user