-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixe right label alignment of a choice menu item that was not set at …
…first popup
- Loading branch information
Showing
11 changed files
with
137 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/Toplo-Widget-Menu-Tests/ToChoiceMenuInSpaceTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
Class { | ||
#name : #ToChoiceMenuInSpaceTest, | ||
#superclass : #ToParameterizedHostTest, | ||
#category : #'Toplo-Widget-Menu-Tests-Choice menu' | ||
} | ||
|
||
{ #category : #tests } | ||
ToChoiceMenuInSpaceTest >> testChoiceItemRightLabelAlignmentOnFirstPopup [ | ||
|
||
| win themeSelect choiceItem ralign | | ||
win := ToInnerWindow new. | ||
themeSelect := ToChoiceMenu new. | ||
themeSelect withStrictCheckingStrategy. | ||
themeSelect defaultSelectedIndex: 1. | ||
themeSelect dataToTextConverter: [ :assoc | assoc key ]. | ||
themeSelect data addAll: { | ||
('Raw Light' -> ToRawTheme new). }. | ||
themeSelect addEventHandler: (BlEventHandler | ||
on: ToChoiceChangedEvent | ||
do: [ space toTheme: themeSelect selectedData value ]). | ||
space root addChild: themeSelect. | ||
BlSpace simulateClickOn: themeSelect. | ||
self waitTestingSpaces. | ||
space applyAllSkinInstallers. | ||
self assert: themeSelect menuWindow notNil. | ||
choiceItem := themeSelect menuWindow root firstChild. | ||
self assert: choiceItem icon notNil. | ||
ralign := choiceItem valueOfTokenNamed: #'menu-item-right-label-alignment'. | ||
self assert: ralign notNil. | ||
self assert: choiceItem rightLabelAlignment equals: ralign. | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
ToChoiceMenuInSpaceTest >> testWithStructuredDataWithStrictStrategy [ | ||
|
||
| cb d | | ||
cb := ToChoiceMenu new. | ||
cb withStrictCheckingStrategy. | ||
cb defaultSelectedIndex: 2. | ||
cb dataToTextConverter: [ :assoc | assoc key ]. | ||
cb data addAll: (d := { | ||
('Bee Theme' -> ToBeeTheme). | ||
('Raw Theme' -> ToRawTheme) }). | ||
space root addChild: cb. | ||
|
||
cb addEventHandler: (BlEventHandler | ||
on: ToChoiceSelectedIndexChangeEvent | ||
do: [ cb selectedData ifNotNil: [:data | space toTheme: (data value new) ] ] ). | ||
|
||
cb selectIndex: 1. | ||
self waitTestingSpaces. | ||
self assert: cb selectedData value identicalTo: ToBeeTheme. | ||
self assert: cb label text asString equals: d first key. | ||
self should: [cb selectData: nil] raise: Error. | ||
self assert: cb selectedIndex equals: 1. | ||
self assert: cb label text asString equals: d first key. | ||
self assert: (cb group buttons select: [ :b | b checked ]) size equals: 1 | ||
] | ||
|
||
{ #category : #tests } | ||
ToChoiceMenuInSpaceTest >> testWithStructuredDataWithUncheckingStrategy [ | ||
|
||
| cb d | | ||
cb := ToChoiceMenu new. | ||
cb withUncheckingStrategy. | ||
space root addChild: cb. | ||
cb dataToTextConverter: [ :assoc | assoc key ]. | ||
cb data addAll: (d := { | ||
('Bee Theme' -> ToBeeTheme). | ||
('Raw Theme' -> ToRawTheme) }). | ||
cb selectIndex: 1. | ||
self waitTestingSpaces. | ||
self assert: cb selectedData value identicalTo: ToBeeTheme. | ||
self assert: cb label text asString equals: d first key. | ||
cb selectData: nil. | ||
self assert: cb selectedData isNil. | ||
self assert: cb label isNil. | ||
self assert: (cb group buttons noneSatisfy: [ :b | b checked ]) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters