From 972b4c0c56062245127f8b67be423502a8fd0883 Mon Sep 17 00:00:00 2001 From: Wilhelm Behncke Date: Fri, 21 Jun 2024 19:58:40 +0200 Subject: [PATCH] TASK: Add failing test for #5150, considering "Discard individual 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. --- .../ContentCache/NodesInUserWorkspace.feature | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/Neos.Neos/Tests/Behavior/Features/ContentCache/NodesInUserWorkspace.feature b/Neos.Neos/Tests/Behavior/Features/ContentCache/NodesInUserWorkspace.feature index 90463864f49..ad0872ce9c3 100644 --- a/Neos.Neos/Tests/Behavior/Features/ContentCache/NodesInUserWorkspace.feature +++ b/Neos.Neos/Tests/Behavior/Features/ContentCache/NodesInUserWorkspace.feature @@ -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" @@ -141,3 +141,56 @@ Feature: Tests for the ContentCacheFlusher and cache flushing when applied in us """
[Text Node at the start of the document][Text Node at the end of the document]
""" + + 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: + """ +
[Text Node at the start of the document][Text Node at the end of the document]
+ """ + + 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: + """ +
[Text Node at the start of the document][Text Node in the middle of the document][Text Node at the end of the document]
+ """ + + 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: + """ +
[Text Node at the start of the document][Text Node at the end of the document]
+ """