Skip to content

Commit

Permalink
[Fix] - CI should work, remove test not working with headless
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLEGOFF committed Jul 4, 2023
1 parent b7e272e commit 0a86035
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 50 deletions.
28 changes: 27 additions & 1 deletion src/Pyramid-Tests/PyramidEditorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ Class {
}

{ #category : #tests }
PyramidEditorTest >> testOpenNewEditor [
PyramidEditorTest >> testOpenNewEditorWithSpacePluginInstalled [
"This test does not work on a headless vm. The current CI use a headless vm."

| editor spec |
Smalltalk isInteractiveGraphic ifFalse: [ ^ self skip ].
editor := PyramidPluginManager uniqueInstance makeEditor.
spec := editor window open.
(Duration milliSeconds: 10) wait.
Expand All @@ -21,3 +23,27 @@ PyramidEditorTest >> testOpenNewEditor [
self assert: editor window isClosed.
self deny: spec window isInWorld
]

{ #category : #tests }
PyramidEditorTest >> testOpenNewEditorWithSpacePluginUninstalled [

| editor spec |
editor := PyramidEditorBuilder new
plugins:
(PyramidPluginManager uniqueInstance pluginClasses
reject: [ :class | class name = #PyramidSpacePlugin ]
thenCollect: [ :class | class new ]);
build.

spec := editor window open.
(Duration milliSeconds: 10) wait.
self currentWorld doOneCycle.
self assert: editor window isOpen.
self assert: spec window isInWorld.

editor window close.
(Duration milliSeconds: 10) wait.
self currentWorld doOneCycle.
self assert: editor window isClosed.
self deny: spec window isInWorld
]
51 changes: 2 additions & 49 deletions src/Pyramid-Tests/PyramidSpacePresenterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ Class {
#category : #'Pyramid-Tests-Cases'
}

{ #category : #tests }
PyramidSpacePresenterTest >> testIsInteractive [

self assert: Smalltalk isInteractiveGraphic
]

{ #category : #tests }
PyramidSpacePresenterTest >> testMakeSpacePresenter [

| morphPresenter overlaysManager spec |
| morphPresenter overlaysManager |

self currentWorld displayWorld.
overlaysManager := PyramidOverlaysManager new.
morphPresenter := PyramidSpacePresenter new
Expand All @@ -22,47 +17,5 @@ PyramidSpacePresenterTest >> testMakeSpacePresenter [
self
assert: overlaysManager space host containerMorph
equals: morphPresenter morph.
self deny: overlaysManager space isOpened.

spec := morphPresenter open.
(Duration milliSeconds: 10) wait.
self currentWorld doOneCycle.
self assert: spec window isInWorld.
self assert: overlaysManager space isOpened.

spec close.
(Duration milliSeconds: 10) wait.
self currentWorld doOneCycle.
self deny: spec window isInWorld.
self deny: overlaysManager space isOpened
]

{ #category : #tests }
PyramidSpacePresenterTest >> testSpace [

| space |
space := BlSpace new.
self deny: space isOpened.
space show.
(Duration milliSeconds: 100) wait.
self assert: space isOpened.
space close.
(Duration milliSeconds: 100) wait.
self deny: space isOpened
]

{ #category : #tests }
PyramidSpacePresenterTest >> testWorldRenderer [

| worldRenderer |
worldRenderer := self currentWorld worldState worldRenderer.
self
deny: [ worldRenderer class = BlMorphicWorldRenderer ]
description: 'BlMorphicWorldRenderer'.
self
deny: [ worldRenderer class = NullWorldRenderer ]
description: 'NullWorldRenderer'.
self
assert: [ worldRenderer class = OSWorldRenderer ]
description: 'OSWorldRenderer'
]

0 comments on commit 0a86035

Please sign in to comment.