Skip to content

Commit

Permalink
WIP: Migrate ContentStreamForking tests to not fork explicitly but …
Browse files Browse the repository at this point in the history
…use workspaces

The implicit forking allows us to use workspaces for assertions on the nodes.
  • Loading branch information
mhsdesign committed Jul 1, 2024
1 parent 433f369 commit 80f01de
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ Feature: On forking a content stream, hidden nodes should be correctly copied as
| nodeVariantSelectionStrategy | "allVariants" |

Scenario: on ForkContentStream, the disabled nodes in the target content stream should still be invisible.
When the command ForkContentStream is executed with payload:
| Key | Value |
| sourceContentStreamId | "cs-identifier" |
| contentStreamId | "user-cs-identifier" |

# Uses ForkContentStream implicitly
When the command CreateWorkspace is executed with payload:
| Key | Value |
| baseWorkspaceName | "live" |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-identifier" |

# node aggregate occupation and coverage is not relevant without dimensions and thus not tested

When I am in content stream "user-cs-identifier" and dimension space point {}
When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier"
And VisibilityConstraints are set to "withoutRestrictions"
Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node user-cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have the following child nodes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,26 @@ Feature: ForkContentStream Without Dimensions
| propertiesToUnset | {} |

Scenario: Ensure that the node is available in the forked content stream
When the command "ForkContentStream" is executed with payload:
| Key | Value |
| contentStreamId | "user-cs-identifier" |
| sourceContentStreamId | "cs-identifier" |
And I am in content stream "user-cs-identifier" and dimension space point {}
# Uses ForkContentStream implicitly
When the command CreateWorkspace is executed with payload:
| Key | Value |
| baseWorkspaceName | "live" |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-identifier" |

When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier"

Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}

Scenario: When a change is applied to the forked content stream AFTER the fork, it is not visible in the live content stream.
When the command "ForkContentStream" is executed with payload:
| Key | Value |
| contentStreamId | "user-cs-identifier" |
| sourceContentStreamId | "cs-identifier" |
# Uses ForkContentStream implicitly
When the command CreateWorkspace is executed with payload:
| Key | Value |
| baseWorkspaceName | "live" |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-identifier" |

And the event NodePropertiesWereSet was published with payload:
| Key | Value |
| workspaceName | "user" |
Expand All @@ -73,26 +80,30 @@ Feature: ForkContentStream Without Dimensions
| propertyValues | {"text": {"value": "modified value", "type": "string"}} |
| propertiesToUnset | {} |

# live
When I am in content stream "cs-identifier" and dimension space point {}
# live
When I am in workspace "live" and dimension space point {}
Then I expect the workspace to point to content stream "cs-identifier"
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{}
And I expect this node to have the following properties:
| Key | Value |
| text | "original value" |

# forked content stream
When I am in content stream "user-cs-identifier" and dimension space point {}
When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier"
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}
And I expect this node to have the following properties:
| Key | Value |
| text | "modified value" |

# this is a "reverse" scenario of the scenario above.
Scenario: When a change is applied on the live content stream AFTER the fork, it is NOT visible in the forked content stream.
When the command "ForkContentStream" is executed with payload:
| Key | Value |
| contentStreamId | "user-cs-identifier" |
| sourceContentStreamId | "cs-identifier" |
# Uses ForkContentStream implicitly
When the command CreateWorkspace is executed with payload:
| Key | Value |
| baseWorkspaceName | "live" |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-identifier" |
And the event NodePropertiesWereSet was published with payload:
| Key | Value |
| workspaceName | "live" |
Expand All @@ -104,14 +115,16 @@ Feature: ForkContentStream Without Dimensions
| propertiesToUnset | {} |

# live
When I am in content stream "cs-identifier" and dimension space point {}
When I am in workspace "live" and dimension space point {}
Then I expect the workspace to point to content stream "cs-identifier"
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{}
And I expect this node to have the following properties:
| Key | Value |
| text | "modified value" |

# forked content stream
When I am in content stream "user-cs-identifier" and dimension space point {}
When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier"
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}
And I expect this node to have the following properties:
| Key | Value |
Expand Down

0 comments on commit 80f01de

Please sign in to comment.