From b6571e32d23f9d6570e1872abc478a37d66c8ff8 Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Tue, 30 Aug 2022 18:05:19 +0200 Subject: [PATCH] Update tests with new properties --- .../ContainerProperties.test.tsx | 6 +- .../ElementsSidebar/ElementsSidebar.test.tsx | 85 ++++--------------- 2 files changed, 22 insertions(+), 69 deletions(-) diff --git a/src/Components/ContainerProperties/ContainerProperties.test.tsx b/src/Components/ContainerProperties/ContainerProperties.test.tsx index d0a2c38..b660475 100644 --- a/src/Components/ContainerProperties/ContainerProperties.test.tsx +++ b/src/Components/ContainerProperties/ContainerProperties.test.tsx @@ -35,7 +35,11 @@ describe.concurrent('Properties', () => { margin: {}, xPositionReference: XPositionReference.Left, isFlex: false, - isAnchor: false + isAnchor: false, + showChildrenDimensions: true, // TODO: put the dimension at the top (see pdf) + showSelfDimensions: true, // TODO: put the dimension at the bottom (see pdf) + isDimensionBorrower: true, // second dimensions from the bottom + markPositionToDimensionBorrower: false }; const handleChange = vi.fn((key, value) => { diff --git a/src/Components/ElementsSidebar/ElementsSidebar.test.tsx b/src/Components/ElementsSidebar/ElementsSidebar.test.tsx index 5567194..853f80a 100644 --- a/src/Components/ElementsSidebar/ElementsSidebar.test.tsx +++ b/src/Components/ElementsSidebar/ElementsSidebar.test.tsx @@ -5,6 +5,7 @@ import { ElementsSidebar } from './ElementsSidebar'; import { IContainerModel } from '../../Interfaces/IContainerModel'; import { XPositionReference } from '../../Enums/XPositionReference'; import { FindContainerById } from '../../utils/itertools'; +import { DEFAULT_MAINCONTAINER_PROPS } from '../../utils/default'; describe.concurrent('Elements sidebar', () => { it('With a MainContainer', () => { @@ -13,23 +14,7 @@ describe.concurrent('Elements sidebar', () => { mainContainer={{ children: [], parent: null, - properties: { - id: 'main', - parentId: '', - linkedSymbolId: '', - displayedText: 'main', - x: 0, - y: 0, - width: 2000, - height: 100, - margin: {}, - minWidth: 1, - type: 'type', - maxWidth: Infinity, - isFlex: false, - xPositionReference: XPositionReference.Left, - isAnchor: false - }, + properties: DEFAULT_MAINCONTAINER_PROPS, userData: {} }} isOpen={true} @@ -48,23 +33,7 @@ describe.concurrent('Elements sidebar', () => { const mainContainer: IContainerModel = { children: [], parent: null, - properties: { - id: 'main', - parentId: '', - linkedSymbolId: '', - displayedText: 'main', - x: 0, - y: 0, - width: 2000, - height: 100, - margin: {}, - minWidth: 1, - isFlex: false, - maxWidth: Infinity, - type: 'type', - isAnchor: false, - xPositionReference: XPositionReference.Left - }, + properties: DEFAULT_MAINCONTAINER_PROPS, userData: {} }; @@ -110,23 +79,7 @@ describe.concurrent('Elements sidebar', () => { const mainContainer: IContainerModel = { children, parent: null, - properties: { - id: 'main', - parentId: '', - linkedSymbolId: '', - displayedText: 'main', - x: 0, - y: 0, - minWidth: 1, - width: 2000, - height: 100, - xPositionReference: XPositionReference.Left, - margin: {}, - isFlex: false, - maxWidth: Infinity, - type: 'type', - isAnchor: false - }, + properties: DEFAULT_MAINCONTAINER_PROPS, userData: {} }; @@ -149,6 +102,10 @@ describe.concurrent('Elements sidebar', () => { maxWidth: Infinity, type: 'type', isAnchor: false, + showChildrenDimensions: true, + showSelfDimensions: true, + isDimensionBorrower: true, + markPositionToDimensionBorrower: false, xPositionReference: XPositionReference.Left }, userData: {} @@ -174,6 +131,10 @@ describe.concurrent('Elements sidebar', () => { isFlex: false, maxWidth: Infinity, type: 'type', + showChildrenDimensions: true, + showSelfDimensions: true, + isDimensionBorrower: true, + markPositionToDimensionBorrower: false, isAnchor: false }, userData: {} @@ -202,23 +163,7 @@ describe.concurrent('Elements sidebar', () => { const mainContainer: IContainerModel = { children, parent: null, - properties: { - id: 'main', - parentId: '', - linkedSymbolId: '', - displayedText: 'main', - x: 0, - y: 0, - minWidth: 1, - width: 2000, - height: 100, - xPositionReference: XPositionReference.Left, - margin: {}, - isFlex: false, - maxWidth: Infinity, - type: 'type', - isAnchor: false - }, + properties: DEFAULT_MAINCONTAINER_PROPS, userData: {} }; @@ -240,6 +185,10 @@ describe.concurrent('Elements sidebar', () => { isFlex: false, maxWidth: Infinity, type: 'type', + showChildrenDimensions: true, + showSelfDimensions: true, + isDimensionBorrower: true, + markPositionToDimensionBorrower: false, isAnchor: false }, userData: {}