Skip to content

Commit

Permalink
test to check list selection
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Dec 13, 2023
1 parent 829e2dc commit fe87f1f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Toplo-Widget-List-Tests/ToListElementTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,32 @@ Class {
#package : 'Toplo-Widget-List-Tests',
#tag : 'Core'
}

{ #category : 'tests' }
ToListElementTest >> testSelectionCorrectlyRemovedWhenNodeRemoved [

| panel list |
panel := ToPane vertical.
panel constraints horizontal matchParent.
panel layout cellSpacing: 10.

list := ToList new.
list nodeBuilder: [ :node :holder |
| line remBut |
line := ToPane horizontal.
remBut := ToButton new.
remBut withoutSkin.
remBut icon: (ToImage inner: (self iconNamed: #windowClose)).
remBut constraintsDo: [ :c | c linear vertical alignCenter ].
remBut
when: BlClickEvent
do: [ :event |
event consumed: true.
holder infiniteElement data removeAt: holder position ].
line addChild: remBut.

node addChild: line ].
list data addAll: (1 to: 2).
panel addChild: list.

]

0 comments on commit fe87f1f

Please sign in to comment.