Skip to content

Commit

Permalink
FEATURE: Add test cases for change projection
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Nov 29, 2024
1 parent 8f67be4 commit f32acc3
Show file tree
Hide file tree
Showing 9 changed files with 877 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,3 @@ Feature: Create node aggregate with node with dimensions
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} |
| sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} |



# When the command PublishIndividualNodesFromWorkspace is executed with payload:
# | Key | Value |
# | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language":"de"}, "nodeAggregateId": "sir-david-nodenborough"}] |
# | contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
#
# And I expect the ChangeProjection to have the following changes in "user-cs-identifier-remaining":
# | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
# | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} |
# | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} |
# | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} |
#
# Then I expect the ChangeProjection to have no changes in "user-cs-id"
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,32 @@ Feature: Publish nodes without dimensions
| newContentStreamId | "new-user-cs-id" |

Then I expect the ChangeProjection to have no changes in "user-cs-id"
Then I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "cs-identifier"


Scenario: Publish nodes from user workspace to a non live workspace
Given the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |
| baseWorkspaceName | "live" |
| newContentStreamId | "review-workspace-cs-id" |
| Key | Value |
| workspaceName | "review-workspace" |
| baseWorkspaceName | "live" |
| newContentStreamId | "review-cs-id" |

And the command RebaseWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |

And I am in workspace "review-workspace"

Then the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |

And the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-workspace" |
| baseWorkspaceName | "review-workspace" |
| newContentStreamId | "user-cs-id" |
| Key | Value |
| workspaceName | "user-workspace" |
| baseWorkspaceName | "review-workspace" |
| newContentStreamId | "user-cs-id" |

And the command RebaseWorkspace is executed with payload:
| Key | Value |
Expand All @@ -87,20 +94,28 @@ Feature: Publish nodes without dimensions
And I am in dimension space point {}
Then the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |
| nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} |
| sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} |

Then I expect the ChangeProjection to have the following changes in "user-cs-id":
Then I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {} |

Then I expect the ChangeProjection to have the following changes in "user-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} |

And the command PublishWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-workspace" |
| Key | Value |
| workspaceName | "user-workspace" |
| newContentStreamId | "new-user-cs-id" |

Then I expect the ChangeProjection to have no changes in "user-cs-id"
Then I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} |
And I expect the ChangeProjection to have no changes in "cs-identifier"
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,27 @@ Feature: Publish nodes with dimensions
| newContentStreamId | "new-user-cs-id" |

Then I expect the ChangeProjection to have no changes in "user-cs-id"
Then I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "cs-identifier"

Scenario: Publish nodes from user workspace to a non live workspace
Given the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |
| baseWorkspaceName | "live" |
| newContentStreamId | "review-workspace-cs-id" |
| newContentStreamId | "review-cs-id" |

And the command RebaseWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |

And I am in workspace "review-workspace"

Then I am in dimension space point {"language": "de"}
And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |

And the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-workspace" |
Expand All @@ -94,7 +102,6 @@ Feature: Publish nodes with dimensions
Then I am in dimension space point {"language": "de"}
And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |
| nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} |
| sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} |

Expand All @@ -115,9 +122,12 @@ Feature: Publish nodes with dimensions
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} |

Then I expect the ChangeProjection to have the following changes in "user-cs-id":
Then I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} |

Then I expect the ChangeProjection to have the following changes in "user-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} |
| sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} |
Expand All @@ -129,8 +139,15 @@ Feature: Publish nodes with dimensions
| newContentStreamId | "new-user-cs-id" |

Then I expect the ChangeProjection to have no changes in "user-cs-id"
Then I expect the ChangeProjection to have no changes in "new-user-cs-id"

And I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} |
| sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} |
And I expect the ChangeProjection to have no changes in "cs-identifier"

Scenario: Publish nodes from user workspace to live with new generalization
Given the command CreateWorkspace is executed with payload:
Expand Down Expand Up @@ -170,3 +187,4 @@ Feature: Publish nodes with dimensions

Then I expect the ChangeProjection to have no changes in "user-cs-id"
Then I expect the ChangeProjection to have no changes in "new-user-cs-id"
And I expect the ChangeProjection to have no changes in "cs-identifier"
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Feature: Publish nodes partially without dimensions
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |

When an asset exists with id "asset-1"
And an asset exists with id "asset-2"
And an asset exists with id "asset-3"

Scenario: Publish nodes partially from user workspace to live
Given the command CreateWorkspace is executed with payload:
| Key | Value |
Expand Down Expand Up @@ -59,30 +55,38 @@ Feature: Publish nodes partially without dimensions
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
| contentStreamIdForRemainingPart | "user-cs-id-remaining" |

Then I expect the ChangeProjection to have the following changes in "user-cs-identifier-remaining":
Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} |
And I expect the ChangeProjection to have no changes in "user-cs-id"
And I expect the ChangeProjection to have no changes in "cs-identifier"

Scenario: Publish nodes partially from user workspace to a non live workspace
Given the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |
| baseWorkspaceName | "live" |
| newContentStreamId | "review-workspace-cs-id" |
| Key | Value |
| workspaceName | "review-workspace" |
| baseWorkspaceName | "live" |
| newContentStreamId | "review-cs-id" |

And the command RebaseWorkspace is executed with payload:
| Key | Value |
| workspaceName | "review-workspace" |

When I am in workspace "review-workspace"

And I am in dimension space point {}
Then the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |

And the command CreateWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-workspace" |
| baseWorkspaceName | "review-workspace" |
| newContentStreamId | "user-cs-id" |
| Key | Value |
| workspaceName | "user-workspace" |
| baseWorkspaceName | "review-workspace" |
| newContentStreamId | "user-cs-id" |

And the command RebaseWorkspace is executed with payload:
| Key | Value |
Expand All @@ -92,24 +96,30 @@ Feature: Publish nodes partially without dimensions

And I am in dimension space point {}
Then the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} |
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} |
| sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} |

Then I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {} |

Then I expect the ChangeProjection to have the following changes in "user-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} |

When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
| Key | Value |
| nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "nody-mc-nodeface"}] |
| contentStreamIdForRemainingPart | "user-cs-id-remaining" |

Then I expect the ChangeProjection to have the following changes in "user-cs-identifier-remaining":
Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
| sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} |
And I expect the ChangeProjection to have no changes in "user-cs-id"
And I expect the ChangeProjection to have no changes in "user-cs-id"
And I expect the ChangeProjection to have the following changes in "review-cs-id":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| sir-david-nodenborough | 1 | 1 | 0 | 0 | {} |
| nody-mc-nodeface | 1 | 1 | 0 | 0 | {} |
And I expect the ChangeProjection to have no changes in "cs-identifier"
Loading

0 comments on commit f32acc3

Please sign in to comment.