/
SpAbstractListCommonPropertiestTest.class.st
68 lines (51 loc) · 1.73 KB
/
SpAbstractListCommonPropertiestTest.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Class {
#name : #SpAbstractListCommonPropertiestTest,
#superclass : #SpAbstractWidgetAdapterTest,
#category : #'Spec2-Backend-Tests'
}
{ #category : #testing }
SpAbstractListCommonPropertiestTest class >> isAbstract [
^ self == SpAbstractListCommonPropertiestTest
]
{ #category : #running }
SpAbstractListCommonPropertiestTest >> initializeTestedInstance [
presenter items: #(10 20 30).
]
{ #category : #running }
SpAbstractListCommonPropertiestTest >> testChangeListInPresenterUpdatesWidget [
self presenter items: #( '1' '2' '3').
backendForTest assertList: self adapter displayItems: #('1' '2' '3')
]
{ #category : #running }
SpAbstractListCommonPropertiestTest >> testDoubleClickActivatesRowInDoubleClickActivationMode [
| activated |
activated := false.
self presenter activateOnDoubleClick.
self presenter whenActivatedDo: [ activated := true ].
backendForTest doubleClickFirstRowAndColumn: self adapter.
self assert: activated
]
{ #category : #'tests - scrolling' }
SpAbstractListCommonPropertiestTest >> testFirstVisibleRowIsInitiallyFirstRow [
presenter items: (1 to: 500).
self openInstance.
self assert: presenter verticalAlignment firstVisibleRowIndex equals: 1
]
{ #category : #tests }
SpAbstractListCommonPropertiestTest >> testRightClickShowsMenu [
| menu |
presenter contextMenu: (menu := SpMockMenuPresenter new).
self deny: menu shown.
self emulateRightClick.
self assert: menu shown
]
{ #category : #running }
SpAbstractListCommonPropertiestTest >> testSingleClickActivatesRowInSingleClickActivationMode [
| activated |
activated := false.
self presenter
activateOnSingleClick;
whenActivatedDo: [ activated := true ].
backendForTest clickFirstRowAndColumn: self adapter.
self assert: activated.
]