diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-26 12:01:40 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-26 12:01:40 -0600 |
commit | 838fc601c1f89f028862212d169aebe4163c8672 (patch) | |
tree | e00dd942ea0b07f1560e4580c6f273a746c4808c /__tests__/lib | |
parent | 8652b74a38f67e7f88890c9c3eb3be090b53462c (diff) | |
download | voidsky-838fc601c1f89f028862212d169aebe4163c8672.tar.zst |
Start with highest quality compression and find a suitable size (#33)
Diffstat (limited to '__tests__/lib')
-rw-r--r-- | __tests__/lib/images.test.ts (renamed from __tests__/lib/download.test.ts) | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/__tests__/lib/download.test.ts b/__tests__/lib/images.test.ts index d90e8c895..461bd04cc 100644 --- a/__tests__/lib/download.test.ts +++ b/__tests__/lib/images.test.ts @@ -1,4 +1,4 @@ -import {downloadAndResize, DownloadAndResizeOpts} from '../../src/lib/download' +import {downloadAndResize, DownloadAndResizeOpts} from '../../src/lib/images' import ImageResizer from '@bam.tech/react-native-image-resizer' import RNFetchBlob from 'rn-fetch-blob' @@ -16,6 +16,7 @@ describe('downloadAndResize', () => { const mockResizedImage = { path: jest.fn().mockReturnValue('file://resized-image.jpg'), + size: 100, } beforeEach(() => { @@ -37,6 +38,7 @@ describe('downloadAndResize', () => { uri: 'https://example.com/image.jpg', width: 100, height: 100, + maxSize: 500000, mode: 'cover', timeout: 10000, } @@ -56,7 +58,7 @@ describe('downloadAndResize', () => { 100, 100, 'JPEG', - 0.7, + 1, undefined, undefined, undefined, @@ -69,6 +71,7 @@ describe('downloadAndResize', () => { uri: 'invalid-uri', width: 100, height: 100, + maxSize: 500000, mode: 'cover', timeout: 10000, } @@ -83,6 +86,7 @@ describe('downloadAndResize', () => { uri: 'https://example.com/image.bmp', width: 100, height: 100, + maxSize: 500000, mode: 'cover', timeout: 10000, } |