-
-
Notifications
You must be signed in to change notification settings - Fork 218
/
RouteCache.feature
172 lines (152 loc) · 9.4 KB
/
RouteCache.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@flowEntities @contentrepository
Feature: Route cache invalidation
Background:
Given using no content dimensions
And using the following node types:
"""yaml
'Neos.Neos:Sites':
superTypes:
'Neos.ContentRepository:Root': true
'Neos.Neos:Document': {}
'Neos.Neos:Content': {}
'Neos.Neos:Test.Routing.Page':
superTypes:
'Neos.Neos:Document': true
properties:
uriPathSegment:
type: string
'Neos.Neos:Test.Routing.Content':
superTypes:
'Neos.Neos:Content': true
properties:
uriPathSegment:
type: string
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And I am user identified by "initiating-user-identifier"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| newContentStreamId | "cs-identifier" |
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.Neos:Sites" |
And the graph projection is fully up to date
# lady-eleonode-rootford
# shernode-homes
# sir-david-nodenborough
# duke-of-contentshire (content node)
# earl-o-documentbourgh
# nody-mc-nodeface
#
And I am in content stream "cs-identifier" and dimension space point {}
And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | parentNodeAggregateId | nodeTypeName | initialPropertyValues | nodeName |
| shernode-homes | lady-eleonode-rootford | Neos.Neos:Test.Routing.Page | {"uriPathSegment": "ignore-me"} | node1 |
| sir-david-nodenborough | shernode-homes | Neos.Neos:Test.Routing.Page | {"uriPathSegment": "david-nodenborough"} | node2 |
| duke-of-contentshire | sir-david-nodenborough | Neos.Neos:Test.Routing.Content | {"uriPathSegment": "ignore-me"} | node3 |
| earl-o-documentbourgh | sir-david-nodenborough | Neos.Neos:Test.Routing.Page | {"uriPathSegment": "earl-document"} | node4 |
| nody-mc-nodeface | shernode-homes | Neos.Neos:Test.Routing.Page | {"uriPathSegment": "nody"} | node5 |
And A site exists for node name "node1"
And the sites configuration is:
"""
Neos:
Neos:
sites:
'node1':
preset: default
uriPathSuffix: ''
contentDimensions:
resolver:
factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\NoopResolverFactory
"""
And The documenturipath projection is up to date
Scenario: Change uri path segment invalidates route cache
When I am on URL "/"
And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}"
And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}"
And the command SetNodeProperties is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "sir-david-nodenborough" |
| originDimensionSpacePoint | {} |
| propertyValues | {"uriPathSegment": "david-nodenborough-updated"} |
And The documenturipath projection is up to date
Then No node should match URL "/david-nodenborough"
And No node should match URL "/david-nodenborough/earl-document"
Scenario: Change uri path segment multiple times invalidates route cache
When I am on URL "/"
And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}"
And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}"
When the command SetNodeProperties is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "sir-david-nodenborough" |
| originDimensionSpacePoint | {} |
| propertyValues | {"uriPathSegment": "david-nodenborough-updated-a"} |
And The documenturipath projection is up to date
When the command SetNodeProperties is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "sir-david-nodenborough" |
| originDimensionSpacePoint | {} |
| propertyValues | {"uriPathSegment": "david-nodenborough-updated-b"} |
And The documenturipath projection is up to date
Then No node should match URL "/david-nodenborough"
And No node should match URL "/david-nodenborough/earl-document"
Then No node should match URL "/david-nodenborough-updated-a"
And No node should match URL "/david-nodenborough-updated-a/earl-document"
Scenario: Move node upwards in the tree invalidates route cache
When I am on URL "/earl-document"
And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}"
And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}"
When the command MoveNodeAggregate is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "earl-o-documentbourgh" |
| dimensionSpacePoint | {} |
| newParentNodeAggregateId | "shernode-homes" |
| newSucceedingSiblingNodeAggregateId | null |
And The documenturipath projection is up to date
Then No node should match URL "/david-nodenborough/earl-document"
Scenario: Move node downwards in the tree invalidates route cache
When I am on URL "/david-nodenborough/earl-document/nody"
And The URL "/nody" should match the node "nody-mc-nodeface" in content stream "cs-identifier" and dimension "{}"
When the command MoveNodeAggregate is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
| dimensionSpacePoint | {} |
| newParentNodeAggregateId | "earl-o-documentbourgh" |
| newSucceedingSiblingNodeAggregateId | null |
And The documenturipath projection is up to date
Then No node should match URL "/nody"
Scenario: Disable node aggregate invalidates route cache
When I am on URL "/earl-document"
And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}"
And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}"
When the command DisableNodeAggregate is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "sir-david-nodenborough" |
| coveredDimensionSpacePoint | {} |
| nodeVariantSelectionStrategy | "allVariants" |
And The documenturipath projection is up to date
Then No node should match URL "/david-nodenborough"
And No node should match URL "/david-nodenborough/earl-document"
Scenario: Removed node aggregate invalidates route cache
When I am on URL "/earl-document"
And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}"
And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}"
When the command RemoveNodeAggregate is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "sir-david-nodenborough" |
| coveredDimensionSpacePoint | {} |
| nodeVariantSelectionStrategy | "allVariants" |
And The documenturipath projection is up to date
Then No node should match URL "/david-nodenborough"
And No node should match URL "/david-nodenborough/earl-document"