diff --git a/ghost/core/test/e2e-api/admin/images.test.js b/ghost/core/test/e2e-api/admin/images.test.js index ee882b35cb..8d4aad72ea 100644 --- a/ghost/core/test/e2e-api/admin/images.test.js +++ b/ghost/core/test/e2e-api/admin/images.test.js @@ -342,7 +342,7 @@ describe('Images API', function () { const brokenPayload = '--boundary\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example.png\"\r\nContent-Type: image/png\r\n\r\n'; // eslint-disable-next-line no-undef - const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, blob.size / 2)], { + const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, Math.floor(blob.size / 2))], { type: 'multipart/form-data; boundary=boundary' })).text(); @@ -367,7 +367,7 @@ describe('Images API', function () { const brokenPayload = '--boundary\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example.png\"\r\nContent-Type: image/png\r\n'; // eslint-disable-next-line no-undef - const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, blob.size / 2)], { + const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, Math.floor(blob.size / 2))], { type: 'multipart/form-data; boundary=boundary' })).text(); diff --git a/ghost/core/test/e2e-api/admin/media.test.js b/ghost/core/test/e2e-api/admin/media.test.js index 0baaef3e5a..5f88cb489e 100644 --- a/ghost/core/test/e2e-api/admin/media.test.js +++ b/ghost/core/test/e2e-api/admin/media.test.js @@ -140,7 +140,7 @@ describe('Media API', function () { const brokenPayload = '--boundary\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example.png\"\r\nContent-Type: image/png\r\n\r\n'; // eslint-disable-next-line no-undef - const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, blob.size / 2)], { + const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, Math.floor(blob.size / 2))], { type: 'multipart/form-data; boundary=boundary' })).text(); @@ -164,7 +164,7 @@ describe('Media API', function () { const brokenPayload = '--boundary\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example.png\"\r\nContent-Type: image/png\r\n'; // eslint-disable-next-line no-undef - const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, blob.size / 2)], { + const brokenDataBlob = await (new Blob([brokenPayload, blob.slice(0, Math.floor(blob.size / 2))], { type: 'multipart/form-data; boundary=boundary' })).text();