Skip to content

Commit

Permalink
Merge pull request #1599 from tinchodias/1598-SpTextInputFieldAdapter…
Browse files Browse the repository at this point in the history
…Test-queries-the-widget-directly-instead-of-the-adapter

Fix adapter tests, that should access the widget via the adapter, not directly.
  • Loading branch information
Ducasse authored Sep 11, 2024
2 parents e23b559 + 97956bf commit d4afe08
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ SpMorphicTextInputFieldAdapter >> isPassword [
^ self widget font isKindOf: FixedFaceFont
]

{ #category : 'accessing' }
SpMorphicTextInputFieldAdapter >> maxLength [

^ widget maxLength
]

{ #category : 'private' }
SpMorphicTextInputFieldAdapter >> setEditable: aBoolean to: aWidget [

Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Backend-Tests/SpCheckboxAdapterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SpCheckboxAdapterTest >> testChangeDeactivatedAfterOpenCheckboxDectivatesIt [
SpCheckboxAdapterTest >> testChangingLabelAffectTheWidget [

presenter label: 'ALabel'.
self assert: self widget label equals: 'ALabel'
self assert: self adapter label equals: 'ALabel'
]

{ #category : 'tests' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Backend-Tests/SpRadioButtonAdapterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SpRadioButtonAdapterTest >> classToTest [
SpRadioButtonAdapterTest >> testChangingLabelAffectTheWidget [

presenter label: 'ALabel'.
self assert: self widget label equals: 'ALabel'
self assert: self adapter label equals: 'ALabel'
]

{ #category : 'tests' }
Expand Down
4 changes: 2 additions & 2 deletions src/Spec2-Backend-Tests/SpTextInputFieldAdapterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SpTextInputFieldAdapterTest >> testChangeWidgetTextUpdatesPresenter [
SpTextInputFieldAdapterTest >> testMaxLengthIsSetInWidget [

presenter maxLength: 10.
self assert: self widget maxLength equals: 10
self assert: self adapter maxLength equals: 10
]

{ #category : 'tests' }
Expand All @@ -44,5 +44,5 @@ SpTextInputFieldAdapterTest >> testPasswordIsSetInWidget [
SpTextInputFieldAdapterTest >> testPresenterTextIsSetInWidget [

presenter text: 'something'.
self assert: self widget text equals: 'something'
self assert: self adapter getText equals: 'something'
]

0 comments on commit d4afe08

Please sign in to comment.