Skip to content

Commit

Permalink
TASK: Add failing test for neos#5150, considering "Discard individual…
Browse files Browse the repository at this point in the history
… nodes"

Discarding individual nodes works through a separate command that still
needs to be considered by the recently introduced cache invalidation
mechanism in `WorkspaceProjectorCatchUpHookForCacheFlushing`.

This commit introduces a test that illustrates the issue.
  • Loading branch information
grebaldi committed Jun 21, 2024
1 parent 19b95c2 commit 972b4c0
Showing 1 changed file with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Feature: Tests for the ContentCacheFlusher and cache flushing when applied in us
}
"""

Scenario: ContentCache gets flushed when a node that was just created gets discarded
Scenario: ContentCache gets flushed when a node that was just created gets discarded via "Discard All"
Given I have Fusion content cache enabled
And I am in workspace "user-editor" and dimension space point {}
And the Fusion context node is "test-document-with-contents"
Expand Down Expand Up @@ -141,3 +141,56 @@ Feature: Tests for the ContentCacheFlusher and cache flushing when applied in us
"""
<div class="neos-contentcollection">[Text Node at the start of the document][Text Node at the end of the document]</div>
"""

Scenario: ContentCache gets flushed when a node that was just created gets discarded via "Discard Individual Nodes"
Given I have Fusion content cache enabled
And I am in workspace "user-editor" and dimension space point {}
And the Fusion context node is "test-document-with-contents"
And I execute the following Fusion code:
"""fusion
test = Neos.Neos:ContentCollection {
nodePath = "main"
}
"""
Then I expect the following Fusion rendering result:
"""
<div class="neos-contentcollection">[Text Node at the start of the document][Text Node at the end of the document]</div>
"""

When the command CreateNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "text-node-middle" |
| nodeTypeName | "Neos.Neos:Test.TextNode" |
| parentNodeAggregateId | "test-document-with-contents--main" |
| initialPropertyValues | {"text": "Text Node in the middle of the document"} |
| succeedingSiblingNodeAggregateId | "text-node-end" |
| nodeName | "text-node-middle" |
And I execute the following Fusion code:
"""fusion
test = Neos.Neos:ContentCollection {
nodePath = "main"
}
"""
Then I expect the following Fusion rendering result:
"""
<div class="neos-contentcollection">[Text Node at the start of the document][Text Node in the middle of the document][Text Node at the end of the document]</div>
"""

When the command DiscardIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-editor" |
| nodesToDiscard | [{"nodeAggregateId": "text-node-middle", "dimensionSpacePoint": {}}] |
| newContentStreamId | "cs-identifier-modified" |
And I am in workspace "user-editor" and dimension space point {}
Then I expect node aggregate identifier "text-node-middle" to lead to no node

When I execute the following Fusion code:
"""fusion
test = Neos.Neos:ContentCollection {
nodePath = "main"
}
"""
Then I expect the following Fusion rendering result:
"""
<div class="neos-contentcollection">[Text Node at the start of the document][Text Node at the end of the document]</div>
"""

0 comments on commit 972b4c0

Please sign in to comment.