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 Dec 2, 2024
1 parent f32acc3 commit 4ec2b55
Show file tree
Hide file tree
Showing 15 changed files with 1,126 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Create node aggregate with node without dimensions
Given I am in workspace "live"

And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| 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"} |
Expand All @@ -54,7 +54,7 @@ Feature: Create node aggregate with node without dimensions
Given I am in workspace "user-workspace"

And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| 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"} |
Expand All @@ -65,4 +65,4 @@ Feature: Create node aggregate with node without dimensions
| 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 "live"
And I expect the ChangeProjection to have no changes in "cs-identifier"
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ Feature: Create node aggregate with node with dimensions
| nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues |
| sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a french text about Sir Nodeward Nodington III"} |

Then I expect the ChangeProjection to have the following changes in "live":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
Then I expect the ChangeProjection to have no changes in "cs-identifier"


Scenario: Nodes on user workspace have been created
Expand All @@ -77,3 +76,4 @@ 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"} |
And I expect the ChangeProjection to have no changes in "cs-identifier"
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@contentrepository @adapters=DoctrineDBAL
@flowEntities
Feature: Create node generalization variant

Background:
Given using the following content dimensions:
| Identifier | Values | Generalizations |
| language | de,gsw,fr,en | gsw->de->en, fr |
And using the following node types:
"""yaml
'Neos.ContentRepository.Testing:Node':
properties:
text:
type: string
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |

And I am in workspace "live"
And I am in dimension space point {"language": "de"}
And I am user identified by "initiating-user-identifier"
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |

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-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} |

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

Scenario: Create node generalization variant of node with
When I am in workspace "user-workspace" and dimension space point {"language":"de"}
And the command CreateNodeVariant is executed with payload:
| Key | Value |
| nodeAggregateId | "sir-david-nodenborough" |
| sourceOrigin | {"language":"de"} |
| targetOrigin | {"language":"en"} |

Then I expect the ChangeProjection to have no changes in "cs-identifier"
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 | {"language":"en"} |

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

Then I expect the ChangeProjection to have no changes in "cs-identifier"
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-workspace-cs-id"
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@contentrepository @adapters=DoctrineDBAL
@flowEntities
Feature: Create node specialization variant

Background:
Given using the following content dimensions:
| Identifier | Values | Generalizations |
| language | de,gsw,fr | gsw->de, fr |
And using the following node types:
"""yaml
'Neos.ContentRepository.Testing:Node':
properties:
text:
type: string
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |

And I am in workspace "live"
And I am in dimension space point {"language": "de"}
And I am user identified by "initiating-user-identifier"
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |


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-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a french text about Sir Nodeward Nodington III"} |


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

Scenario: Create node specialization variant of node
When I am in workspace "user-workspace" and dimension space point {"language":"de"}
And the command CreateNodeVariant is executed with payload:
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| sourceOrigin | {"language":"de"} |
| targetOrigin | {"language":"gsw"} |

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":"gsw"} |
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@contentrepository @adapters=DoctrineDBAL
@flowEntities
Feature: Create node peer variant with internal workspace between live and user workspace

Background:
Given using the following content dimensions:
| Identifier | Values | Generalizations |
| language | de,gsw,fr | gsw->de, fr |
And using the following node types:
"""yaml
'Neos.ContentRepository.Testing:Node':
properties:
text:
type: string
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |

And I am in workspace "live"
And I am in dimension space point {"language": "de"}
And I am user identified by "initiating-user-identifier"
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |


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-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} |

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

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

Scenario: Create node peer variant of node

When I am in workspace "internal-workspace" and dimension space point {"language":"de"}
And the command CreateNodeVariant is executed with payload:
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| sourceOrigin | {"language":"de"} |
| targetOrigin | {"language":"gsw"} |

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

Scenario: Create node peer variant of node

When I am in workspace "user-workspace" and dimension space point {"language":"de"}
And the command CreateNodeVariant is executed with payload:
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| sourceOrigin | {"language":"de"} |
| targetOrigin | {"language":"gsw"} |

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":"gsw"} |
And I expect the ChangeProjection to have no changes in "cs-identifier"
And I expect the ChangeProjection to have no changes in "internal-cs-id"
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@contentrepository @adapters=DoctrineDBAL
@flowEntities
Feature: Create node peer variant

Background:
Given using the following content dimensions:
| Identifier | Values | Generalizations |
| language | de,gsw,fr | gsw->de, fr |
And using the following node types:
"""yaml
'Neos.ContentRepository.Testing:Node':
properties:
text:
type: string
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |

And I am in workspace "live"
And I am in dimension space point {"language": "de"}
And I am user identified by "initiating-user-identifier"
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |

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"} |

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

Scenario: Create node peer variant of node
When I am in workspace "user-workspace" and dimension space point {"language":"de"}
And the command CreateNodeVariant is executed with payload:
| Key | Value |
| nodeAggregateId | "sir-david-nodenborough" |
| sourceOrigin | {"language":"de"} |
| targetOrigin | {"language":"fr"} |

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 | {"language":"fr"} |
And I expect the ChangeProjection to have no changes in "cs-identifier"
Loading

0 comments on commit 4ec2b55

Please sign in to comment.