From da3bf7567514236f958e51b773fd9ecdfa66b174 Mon Sep 17 00:00:00 2001 From: sqzhou Date: Mon, 13 Nov 2023 11:00:24 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=99=9A=E4=B8=8A=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E9=9B=86=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../amis/__tests__/renderers/Image.test.tsx | 15 +---- .../__snapshots__/Image.test.tsx.snap | 60 +++++++++++++++---- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/packages/amis/__tests__/renderers/Image.test.tsx b/packages/amis/__tests__/renderers/Image.test.tsx index 8fe8757eecd9..402f398e562b 100644 --- a/packages/amis/__tests__/renderers/Image.test.tsx +++ b/packages/amis/__tests__/renderers/Image.test.tsx @@ -215,18 +215,7 @@ describe('Renderer:image', () => { '.cxd-ImageGallery-toolbar .cxd-ImageGallery-toolbar-action' ); - expect(actions!.length).toBe(5); - - const imgIns = baseElement.querySelector('.cxd-ImageGallery-main img')!; - - expect(imgIns).toHaveStyle({ - transform: 'translate(0px, 0px) scale(1) rotate(0deg)' - }); - - fireEvent.click(actions[1].firstElementChild!); - expect(imgIns).toHaveStyle({ - transform: 'translate(0px, 0px) scale(1) rotate(90deg)' - }); + expect(actions!.length).toBe(4); }); test('image:width & height', async () => { @@ -653,7 +642,7 @@ describe('Renderer:images', () => { expect( baseElement.querySelectorAll( - '.cxd-ImageGallery-footer .cxd-ImageGallery-itemsWrap .cxd-ImageGallery-item' + '.cxd-Sliding-content-lists .cxd-Sliding-content-lists-item' )!.length ).toBe(3); }); diff --git a/packages/amis/__tests__/renderers/__snapshots__/Image.test.tsx.snap b/packages/amis/__tests__/renderers/__snapshots__/Image.test.tsx.snap index db441d13cd27..67929dbfedde 100644 --- a/packages/amis/__tests__/renderers/__snapshots__/Image.test.tsx.snap +++ b/packages/amis/__tests__/renderers/__snapshots__/Image.test.tsx.snap @@ -704,15 +704,27 @@ exports[`Renderer:images images:enlargeAble & originalSrc & source & title & des >
- 图片1 + + + 图片1 + +
- 图片1的描述 + + + 图片1的描述 + +
@@ -751,15 +763,27 @@ exports[`Renderer:images images:enlargeAble & originalSrc & source & title & des >
- 图片2 + + + 图片2 + +
- 图片2的描述 + + + 图片2的描述 + +
@@ -798,15 +822,27 @@ exports[`Renderer:images images:enlargeAble & originalSrc & source & title & des >
- 图片3 + + + 图片3 + +
- 图片3的描述 + + + 图片3的描述 + +