From 377b41d8a6611133e04dcdd4fc68a9206bc07d6b Mon Sep 17 00:00:00 2001 From: Koen De Hondt Date: Fri, 26 Jan 2024 15:07:39 +0100 Subject: [PATCH] Assert initial window width to ensure correctness of asserts that follow. --- .../SpMorphicBoxLayoutTest.class.st | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Spec2-Morphic-Backend-Tests/SpMorphicBoxLayoutTest.class.st b/src/Spec2-Morphic-Backend-Tests/SpMorphicBoxLayoutTest.class.st index b6df864b..a7b5e161 100644 --- a/src/Spec2-Morphic-Backend-Tests/SpMorphicBoxLayoutTest.class.st +++ b/src/Spec2-Morphic-Backend-Tests/SpMorphicBoxLayoutTest.class.st @@ -95,7 +95,7 @@ SpMorphicBoxLayoutTest >> testBeHomogeneous [ { #category : #tests } SpMorphicBoxLayoutTest >> testBeHomogeneousWorksWhenContractingWindow [ - | presenter p1 p2 p3 windowWidth presenterWidth width1 width2 width3 | + | presenter p1 p2 p3 windowWidth presenterWidth width1 width2 width3 initialWindowWidth | "not working on CI :(" self skipOnPharoCITestingEnvironment. @@ -114,6 +114,8 @@ SpMorphicBoxLayoutTest >> testBeHomogeneousWorksWhenContractingWindow [ [ presenter open. backend waitUntilUIRedrawed. + initialWindowWidth := presenter window adapter widget width. + self assert: initialWindowWidth equals: 400. presenter withWindowDo: [ :window | window adapter widgetDo: [ :widget | "Make the presenter's width a multiple of 3, @@ -136,7 +138,7 @@ SpMorphicBoxLayoutTest >> testBeHomogeneousWorksWhenContractingWindow [ { #category : #tests } SpMorphicBoxLayoutTest >> testBeHomogeneousWorksWhenExpandingWindow [ - | presenter p1 p2 p3 windowWidth presenterWidth width1 width2 width3 | + | presenter p1 p2 p3 windowWidth presenterWidth width1 width2 width3 initialWindowWidth | presenter := SpPresenter new. presenter layout: (SpBoxLayout newHorizontal beHomogeneous; @@ -152,6 +154,8 @@ SpMorphicBoxLayoutTest >> testBeHomogeneousWorksWhenExpandingWindow [ [ presenter open. backend waitUntilUIRedrawed. + initialWindowWidth := presenter window adapter widget width. + self assert: initialWindowWidth equals: 400. presenter withWindowDo: [ :window | window adapter widgetDo: [ :widget | "Make the presenter's width a multiple of 3,