From 682b674809c2105283ba6896690454735f0a149a Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 31 May 2023 22:06:42 +0100 Subject: [PATCH] test: add unit test for correct crop sizing --- test/unit/image.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/unit/image.test.ts b/test/unit/image.test.ts index 329c1fbe2..f8559d3bb 100644 --- a/test/unit/image.test.ts +++ b/test/unit/image.test.ts @@ -54,4 +54,16 @@ describe('Renders simple image', () => { }) expect(img.html()).toMatchInlineSnapshot('""') }) + + it('correctly sets crop', () => { + const img = mount(NuxtImg, { + propsData: { + src: '/image.png', + width: 1000, + height: 2000, + sizes: 'xs:100vw sm:100vw md:300px lg:350px xl:350px 2xl:350px' + } + }) + expect(img.html()).toMatchInlineSnapshot('""') + }) })