|
| 1 | +@contentrepository @adapters=DoctrineDBAL |
| 2 | +Feature: Update Root Node aggregate dimensions |
| 3 | + |
| 4 | + I want to update a root node aggregate's dimensions when the dimension config changes. |
| 5 | + |
| 6 | + Background: |
| 7 | + Given I have the following content dimensions: |
| 8 | + | Identifier | Values | Generalizations | |
| 9 | + | language | mul, de | | |
| 10 | + And I have the following NodeTypes configuration: |
| 11 | + """ |
| 12 | + 'Neos.ContentRepository:Root': [] |
| 13 | + """ |
| 14 | + And I am user identified by "initiating-user-identifier" |
| 15 | + And the command CreateRootWorkspace is executed with payload: |
| 16 | + | Key | Value | |
| 17 | + | workspaceName | "live" | |
| 18 | + | workspaceTitle | "Live" | |
| 19 | + | workspaceDescription | "The live workspace" | |
| 20 | + | newContentStreamId | "cs-identifier" | |
| 21 | + And the graph projection is fully up to date |
| 22 | + And I am in content stream "cs-identifier" |
| 23 | + And the command CreateRootNodeAggregateWithNode is executed with payload: |
| 24 | + | Key | Value | |
| 25 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 26 | + | nodeTypeName | "Neos.ContentRepository:Root" | |
| 27 | + |
| 28 | + |
| 29 | + Scenario: Initial setup of the root node (similar to 01/RootNodeCreation/03-...) |
| 30 | + Then I expect exactly 2 events to be published on stream "ContentStream:cs-identifier" |
| 31 | + And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload: |
| 32 | + | Key | Expected | |
| 33 | + | contentStreamId | "cs-identifier" | |
| 34 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 35 | + | nodeTypeName | "Neos.ContentRepository:Root" | |
| 36 | + | coveredDimensionSpacePoints | [{"language":"mul"},{"language":"de"}] | |
| 37 | + | nodeAggregateClassification | "root" | |
| 38 | + And event metadata at index 1 is: |
| 39 | + | Key | Expected | |
| 40 | + |
| 41 | + When the graph projection is fully up to date |
| 42 | + Then I expect the node aggregate "lady-eleonode-rootford" to exist |
| 43 | + And I expect this node aggregate to be classified as "root" |
| 44 | + And I expect this node aggregate to be of type "Neos.ContentRepository:Root" |
| 45 | + And I expect this node aggregate to be unnamed |
| 46 | + And I expect this node aggregate to occupy dimension space points [[]] |
| 47 | + And I expect this node aggregate to cover dimension space points [{"language":"mul"},{"language":"de"}] |
| 48 | + And I expect this node aggregate to disable dimension space points [] |
| 49 | + And I expect this node aggregate to have no parent node aggregates |
| 50 | + And I expect this node aggregate to have no child node aggregates |
| 51 | + |
| 52 | + And I expect the graph projection to consist of exactly 1 node |
| 53 | + And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph |
| 54 | + And I expect this node to be classified as "root" |
| 55 | + And I expect this node to be of type "Neos.ContentRepository:Root" |
| 56 | + And I expect this node to be unnamed |
| 57 | + And I expect this node to have no properties |
| 58 | + |
| 59 | + When I am in dimension space point {"language":"mul"} |
| 60 | + Then I expect the subgraph projection to consist of exactly 1 node |
| 61 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 62 | + And I expect this node to be classified as "root" |
| 63 | + And I expect this node to have no parent node |
| 64 | + And I expect this node to have no child nodes |
| 65 | + And I expect this node to have no preceding siblings |
| 66 | + And I expect this node to have no succeeding siblings |
| 67 | + And I expect this node to have no references |
| 68 | + And I expect this node to not be referenced |
| 69 | + |
| 70 | + When I am in dimension space point {"language":"de"} |
| 71 | + Then I expect the subgraph projection to consist of exactly 1 node |
| 72 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 73 | + |
| 74 | + |
| 75 | + Scenario: Adding a dimension and updating the root node works |
| 76 | + When the graph projection is fully up to date |
| 77 | + Given I have the following content dimensions: |
| 78 | + | Identifier | Values | Generalizations | |
| 79 | + | language | mul, de, en | | |
| 80 | + |
| 81 | + # in "en", the root node does not exist. |
| 82 | + When I am in dimension space point {"language":"en"} |
| 83 | + Then I expect the subgraph projection to consist of exactly 0 nodes |
| 84 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to no node |
| 85 | + |
| 86 | + And the command UpdateRootNodeAggregateDimensions is executed with payload: |
| 87 | + | Key | Value | |
| 88 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 89 | + |
| 90 | + Then I expect exactly 3 events to be published on stream "ContentStream:cs-identifier" |
| 91 | + # the updated dimension config is persisted in the event stream |
| 92 | + And event at index 2 is of type "RootNodeAggregateDimensionsWereUpdated" with payload: |
| 93 | + | Key | Expected | |
| 94 | + | contentStreamId | "cs-identifier" | |
| 95 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 96 | + | coveredDimensionSpacePoints | [{"language":"mul"},{"language":"de"},{"language":"en"}] | |
| 97 | + And event metadata at index 1 is: |
| 98 | + | Key | Expected | |
| 99 | + |
| 100 | + When the graph projection is fully up to date |
| 101 | + Then I expect the node aggregate "lady-eleonode-rootford" to exist |
| 102 | + And I expect this node aggregate to be classified as "root" |
| 103 | + And I expect this node aggregate to be of type "Neos.ContentRepository:Root" |
| 104 | + And I expect this node aggregate to be unnamed |
| 105 | + And I expect this node aggregate to occupy dimension space points [[]] |
| 106 | + And I expect this node aggregate to cover dimension space points [{"language":"mul"},{"language":"de"},{"language":"en"}] |
| 107 | + And I expect this node aggregate to disable dimension space points [] |
| 108 | + And I expect this node aggregate to have no parent node aggregates |
| 109 | + And I expect this node aggregate to have no child node aggregates |
| 110 | + |
| 111 | + And I expect the graph projection to consist of exactly 1 node |
| 112 | + And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph |
| 113 | + And I expect this node to be classified as "root" |
| 114 | + And I expect this node to be of type "Neos.ContentRepository:Root" |
| 115 | + And I expect this node to be unnamed |
| 116 | + And I expect this node to have no properties |
| 117 | + |
| 118 | + When I am in dimension space point {"language":"mul"} |
| 119 | + Then I expect the subgraph projection to consist of exactly 1 node |
| 120 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 121 | + And I expect this node to be classified as "root" |
| 122 | + And I expect this node to have no parent node |
| 123 | + And I expect this node to have no child nodes |
| 124 | + And I expect this node to have no preceding siblings |
| 125 | + And I expect this node to have no succeeding siblings |
| 126 | + And I expect this node to have no references |
| 127 | + And I expect this node to not be referenced |
| 128 | + |
| 129 | + When I am in dimension space point {"language":"de"} |
| 130 | + Then I expect the subgraph projection to consist of exactly 1 node |
| 131 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 132 | + |
| 133 | + # now, the root node exists in "en" |
| 134 | + When I am in dimension space point {"language":"en"} |
| 135 | + Then I expect the subgraph projection to consist of exactly 1 node |
| 136 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 137 | + |
| 138 | + |
| 139 | + Scenario: Adding a dimension updating the root node, removing dimension, updating the root node, works (dimension gone again) |
| 140 | + When the graph projection is fully up to date |
| 141 | + Given I have the following content dimensions: |
| 142 | + | Identifier | Values | Generalizations | |
| 143 | + | language | mul, de, en | | |
| 144 | + And the command UpdateRootNodeAggregateDimensions is executed with payload: |
| 145 | + | Key | Value | |
| 146 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 147 | + And the graph projection is fully up to date |
| 148 | + |
| 149 | + # now, the root node exists in "en" |
| 150 | + When I am in dimension space point {"language":"en"} |
| 151 | + Then I expect the subgraph projection to consist of exactly 1 nodes |
| 152 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} |
| 153 | + |
| 154 | + # again, remove "en" |
| 155 | + Given I have the following content dimensions: |
| 156 | + | Identifier | Values | Generalizations | |
| 157 | + | language | mul, de, | | |
| 158 | + And the command UpdateRootNodeAggregateDimensions is executed with payload: |
| 159 | + | Key | Value | |
| 160 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 161 | + And the graph projection is fully up to date |
| 162 | + |
| 163 | + # now, the root node should not exist anymore in "en" |
| 164 | + When I am in dimension space point {"language":"en"} |
| 165 | + Then I expect the subgraph projection to consist of exactly 0 nodes |
| 166 | + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to no node |
0 commit comments