-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend-independant interactions. Remove widgets as they are already present in Spec.
- Loading branch information
Showing
25 changed files
with
293 additions
and
1,318 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
Class { | ||
#name : 'SpecInteractionTest', | ||
#superclass : 'TestCase', | ||
#instVars : [ | ||
'backend', | ||
'widget' | ||
], | ||
#category : 'Interactions-Tests', | ||
#package : 'Interactions-Tests' | ||
} | ||
|
||
{ #category : 'running' } | ||
SpecInteractionTest >> setUp [ | ||
super setUp. | ||
|
||
backend := SpecInteraction default | ||
] | ||
|
||
{ #category : 'running' } | ||
SpecInteractionTest >> tearDown [ | ||
widget ifNotNil: [ :w | w delete ]. | ||
super tearDown | ||
] | ||
|
||
{ #category : 'tests' } | ||
SpecInteractionTest >> testCanOpenAConfirmation [ | ||
|
||
| confirm window | | ||
confirm := ITConfirmation new | ||
title: 'Remove File'; | ||
message: 'Are you sure you want to delete this file?'; | ||
yesLabel: 'delete'. | ||
|
||
widget := backend for: confirm. | ||
widget doInteraction. | ||
|
||
window := widget window. | ||
self assert: window title equals: confirm title. | ||
self assert: widget label equals: confirm message. | ||
self assertCollection: (window buttons collect: #label) hasSameElements: #('no' 'delete') | ||
] | ||
|
||
{ #category : 'tests' } | ||
SpecInteractionTest >> testCanOpenAFileRequest [ | ||
|
||
| fileRequest window | | ||
fileRequest := ITFileRequest new | ||
title: 'Image file to open?'; | ||
filter: '.image'; | ||
currentFolder: FileLocator home. | ||
|
||
widget := backend for: fileRequest. | ||
widget doInteraction. | ||
|
||
window := widget window. | ||
self assert: window title equals: fileRequest title. | ||
self assert: widget fileNavigationSystem filtersDropList selectedItem basename equals: '.image'. | ||
self assert: widget fileNavigationSystem currentDirectory equals: FileLocator home. | ||
] | ||
|
||
{ #category : 'tests' } | ||
SpecInteractionTest >> testCanOpenAnInformation [ | ||
|
||
| inform window | | ||
inform := ITInformation new | ||
title: 'Some confirmation needed'; | ||
message: 'Do you want to proceed?'. | ||
|
||
widget := backend for: inform. | ||
widget doInteraction. | ||
|
||
window := widget window. | ||
self assert: window title equals: inform title. | ||
self assert: widget label equals: inform message. | ||
self assertCollection: (window buttons collect: #label) hasSameElements: #('Ok') | ||
] | ||
|
||
{ #category : 'tests' } | ||
SpecInteractionTest >> testCanSelectAFile [ | ||
|
||
| fileRequest fs file bImage | | ||
fs := FileSystem memory. | ||
(fs root / 'a.image') ensureCreateFile. | ||
bImage := (fs root / 'b.image') ensureCreateFile. | ||
fileRequest := ITFileRequest new | ||
title: 'Image file to open?'; | ||
filter: '.image'; | ||
currentFolder: fs root; | ||
yourself. | ||
|
||
widget := backend for: fileRequest. | ||
widget doInteraction. | ||
widget selectFile: bImage. | ||
file := widget confirm. | ||
|
||
self assert: widget fileNavigationSystem currentDirectory equals: fs root. | ||
self assert: file equals: bImage | ||
] | ||
|
||
{ #category : 'tests' } | ||
SpecInteractionTest >> testCanSelectAFolder [ | ||
|
||
| fileRequest fs folder bFolder | | ||
fs := FileSystem memory. | ||
(fs root / 'a') ensureCreateDirectory. | ||
bFolder := (fs root / 'b') ensureCreateDirectory. | ||
fileRequest := ITFileRequest new | ||
beForFolderOpening; | ||
title: 'Folder to open?'; | ||
currentFolder: fs root; | ||
yourself. | ||
|
||
widget := backend for: fileRequest. | ||
widget doInteraction. | ||
widget selectFile: bFolder. | ||
folder := widget confirm. | ||
|
||
self assert: widget fileNavigationSystem currentDirectory equals: fs root. | ||
self assert: folder equals: bFolder | ||
] |
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 @@ | ||
Package { #name : 'Interactions-Tests' } |
60 changes: 0 additions & 60 deletions
60
src/Interactions-Widgets-Tests/ITConfirmationPresenterTest.class.st
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
src/Interactions-Widgets-Tests/ITInformationPresenterTest.class.st
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
src/Interactions-Widgets-Tests/ITItemChooserPresenterTest.class.st
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.