Image performance improvements (#126)

* Switch out most images for FastImage

* Add image loading placeholders

* Fix tests
This commit is contained in:
Paul Frazee
2023-01-31 17:01:02 -06:00
committed by GitHub
parent 0ce4f57e0b
commit 5ccdec1e4f
17 changed files with 182 additions and 186 deletions
@@ -36,16 +36,14 @@ describe('SelectedPhoto', () => {
const selectedPhotoImage = await findByTestId('selectedPhotoImage')
expect(selectedPhotoImage).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage).toHaveStyle({width: 250})
})
it('has 2 photos to render', async () => {
const {findAllByTestId} = render(<SelectedPhoto {...mockedProps} />)
const selectedPhotoImage = await findAllByTestId('selectedPhotoImage')
expect(selectedPhotoImage[0]).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage[0]).toHaveStyle({width: 175})
expect(selectedPhotoImage[1]).toBeTruthy()
expect(selectedPhotoImage[2]).toBeFalsy()
})
it('has 3 photos to render', async () => {
@@ -57,8 +55,10 @@ describe('SelectedPhoto', () => {
)
const selectedPhotoImage = await findAllByTestId('selectedPhotoImage')
expect(selectedPhotoImage[0]).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage[0]).toHaveStyle({width: 85})
expect(selectedPhotoImage[0]).toBeTruthy()
expect(selectedPhotoImage[1]).toBeTruthy()
expect(selectedPhotoImage[2]).toBeTruthy()
expect(selectedPhotoImage[3]).toBeFalsy()
})
it('removes a photo', async () => {