Skip to content

Commit

Permalink
property activation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ol-Ba committed Jul 30, 2022
1 parent 134d955 commit e3c492d
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditorInstance: anObject
animationsEditorInstance := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditorInstance
^ animationsEditorInstance
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dummy property
dummyProperty

^ self animationsEditorInstance propertyList first subproperties at: 'position'.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
running
setUp

| morph |
super setUp.
self animationsEditorInstance: AnimationsEditor open.
morph := Morph new openInWorld.
self animationsEditorInstance addTargetMorph: morph.
self animationsEditorInstance selectedTreeNode: self dummyProperty.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
running
tearDown
| targetMorph |
super tearDown.
targetMorph := (self animationsEditorInstance propertyList first) targetMorph.
targetMorph isFlexed ifTrue: [targetMorph owner abandon]. "removes FlexShell"
targetMorph abandon.
self animationsEditorInstance windowReference abandon.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
testing
testKeyframeAddedToActivatedProperty
| property keyPreexists|

property := self animationsEditorInstance selectedTreeNode.
property activateProperty.
keyPreexists := property targetValues at: 500 ifAbsent: [false].
property
positionX: 555;
positionY: 555;
frame: 500.
self animationsEditorInstance addKeyframe.
self assert: ((property targetValues at: 500) notNil and: keyPreexists not).
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
testing
testKeyframesDeteledFromTrackWhenPropertyDeactivated
| property |

property := self animationsEditorInstance selectedTreeNode.
property activateProperty.
property
positionX: 555;
positionY: 555;
frame: 500.
self animationsEditorInstance addKeyframe.
property deactivateProperty. self assert: (property targetValues at: 500 ifAbsent: true).
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
testing
testNoActivatedPropertiesOnStart
| allSubpropertiesDeactivated |

allSubpropertiesDeactivated := true.
self animationsEditorInstance propertyList first subproperties do: [:property | property isActivated ifTrue: [allSubpropertiesDeactivated := true.].].
self assert: allSubpropertiesDeactivated.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
testing
testNoKeyframeAddedToDeactivatedProperty
| property |

property := self animationsEditorInstance selectedTreeNode.
property deactivateProperty.
property
positionX: 555;
positionY: 555;
frame: 500.
self animationsEditorInstance addKeyframe.
self assert: (property targetValues at: 500 ifAbsent: true).
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"class" : {
},
"instance" : {
"animationsEditorInstance" : "ob 7/30/2022 17:55",
"animationsEditorInstance:" : "ob 7/30/2022 17:55",
"dummyProperty" : "ob 7/30/2022 17:56",
"setUp" : "ob 7/30/2022 17:57",
"tearDown" : "ob 7/30/2022 17:57",
"testKeyframeAddedToActivatedProperty" : "ob 7/30/2022 18:27",
"testKeyframesDeteledFromTrackWhenPropertyDeactivated" : "ob 7/30/2022 18:21",
"testNoActivatedPropertiesOnStart" : "ob 7/30/2022 18:21",
"testNoKeyframeAddedToDeactivatedProperty" : "ob 7/30/2022 18:21" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "AnimationsEditor-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"animationsEditorInstance" ],
"name" : "AnimationsEditorTogglePropertiesTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }

0 comments on commit e3c492d

Please sign in to comment.