From 242e915decc78ab1f4d01466b4c25fd4dd8f3ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B8egh?= Date: Wed, 15 May 2024 15:29:08 +0200 Subject: [PATCH] Align integration tests --- .../flex/__tests__/Container.test.tsx | 14 +++--- .../components/flex/__tests__/Item.test.tsx | 46 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/dnb-eufemia/src/components/flex/__tests__/Container.test.tsx b/packages/dnb-eufemia/src/components/flex/__tests__/Container.test.tsx index 8eb79874894..321c73fa098 100644 --- a/packages/dnb-eufemia/src/components/flex/__tests__/Container.test.tsx +++ b/packages/dnb-eufemia/src/components/flex/__tests__/Container.test.tsx @@ -361,7 +361,7 @@ describe('Flex.Container', () => { expect(children[1]).toHaveClass('dnb-space__right--small') expect(children[2]).toHaveClass('dnb-space__left--zero') - expect(children[2]).toHaveClass('dnb-space__right--small') + expect(children[2]).toHaveClass('dnb-space__right--zero') rerender( @@ -378,7 +378,7 @@ describe('Flex.Container', () => { expect(children[1]).toHaveClass('dnb-space__right--large') expect(children[2]).toHaveClass('dnb-space__left--zero') - expect(children[2]).toHaveClass('dnb-space__right--large') + expect(children[2]).toHaveClass('dnb-space__right--zero') rerender( @@ -395,7 +395,7 @@ describe('Flex.Container', () => { expect(children[1]).toHaveClass('dnb-space__right--xx-small') expect(children[2]).toHaveClass('dnb-space__left--zero') - expect(children[2]).toHaveClass('dnb-space__right--xx-small') + expect(children[2]).toHaveClass('dnb-space__right--zero') }) it('should not apply spacing if set to false', () => { @@ -613,10 +613,10 @@ describe('Flex.Container', () => { expect(document.querySelectorAll('.wrapper')).toHaveLength(1) expect( document.querySelectorAll('[class*="dnb-space__top"]') - ).toHaveLength(4) + ).toHaveLength(3) expect( document.querySelectorAll('.dnb-space__top--zero') - ).toHaveLength(2) + ).toHaveLength(1) expect( document.querySelectorAll('.dnb-space__top--small') ).toHaveLength(1) @@ -672,7 +672,7 @@ describe('Flex.Container', () => { expect(document.querySelectorAll('.wrapper')).toHaveLength(1) expect( document.querySelectorAll('[class*="dnb-space__"]') - ).toHaveLength(3) + ).toHaveLength(2) }) it('should handle fragments like _supportsSpacingProps=children', () => { @@ -719,7 +719,7 @@ describe('Flex.Container', () => { ).toHaveLength(1) expect( document.querySelectorAll('[class*="dnb-space__"]') - ).toHaveLength(3) + ).toHaveLength(1) }) }) diff --git a/packages/dnb-eufemia/src/components/flex/__tests__/Item.test.tsx b/packages/dnb-eufemia/src/components/flex/__tests__/Item.test.tsx index 0aea7f22e2d..42a62fe68ca 100644 --- a/packages/dnb-eufemia/src/components/flex/__tests__/Item.test.tsx +++ b/packages/dnb-eufemia/src/components/flex/__tests__/Item.test.tsx @@ -221,8 +221,8 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) rerender( @@ -233,8 +233,8 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--zero', 'dnb-space__right--zero'], ]) }) @@ -254,7 +254,7 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--zero'], ]) rerender( @@ -329,7 +329,7 @@ describe('Flex.Item', () => { 'dnb-space__right--large', 'dnb-space__top--medium', ], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) rerender( @@ -369,7 +369,7 @@ describe('Flex.Item', () => { expect(getSpacingClasses()).toEqual([ ['dnb-space__left--zero', 'dnb-space__right--large'], ['dnb-space__left--x-large', 'dnb-space__right--large'], - ['dnb-space__left--small', 'dnb-space__right--zero'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) rerender( @@ -402,8 +402,8 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--large'], - ['dnb-space__left--zero', 'dnb-space__right--large'], + ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--small', 'dnb-space__right--zero'], ]) rerender( @@ -414,8 +414,8 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--zero', 'dnb-space__right--zero'], ]) }) @@ -431,9 +431,9 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) act(() => { @@ -441,9 +441,9 @@ describe('Flex.Item', () => { }) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) }) @@ -459,9 +459,9 @@ describe('Flex.Item', () => { ) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) act(() => { @@ -469,9 +469,9 @@ describe('Flex.Item', () => { }) expect(getSpacingClasses()).toEqual([ - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], - ['dnb-space__left--zero', 'dnb-space__right--small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--zero', 'dnb-space__right--x-small'], + ['dnb-space__left--x-small', 'dnb-space__right--zero'], ]) }) })