From 10562aa5f13fa7e1f17bbaa5e61627869e1abcae Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 3 Nov 2023 15:34:35 +0100 Subject: [PATCH 1/2] TASK: Add tests for FlowQuery `nextUntil`, `prevUntil` and `siblings` --- .../Features/Fusion/FlowQuery.feature | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature index ee4ec0f3ada..10b618bfeee 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature @@ -271,3 +271,44 @@ Feature: Tests for the "Neos.ContentRepository" Flow Query methods. noFilter: a1a5,a1a6,a1a7 withFilter: a1a5,a1a6 """ + + Scenario: NextUntil + When I execute the following Fusion code: + """fusion + test = Neos.Fusion:DataStructure { + criteria = ${q(node).nextUntil('[instanceof Neos.Neos:Test.DocumentType1]').get()} + @process.render = Neos.Neos:Test.RenderNodesDataStructure + } + """ + Then I expect the following Fusion rendering result: + """ + criteria: a1a5,a1a6 + """ + + Scenario: PrevUntil + When I execute the following Fusion code: + """fusion + test = Neos.Fusion:DataStructure { + criteria = ${q(node).prevUntil('[instanceof Neos.Neos:Test.DocumentType1]').get()} + @process.render = Neos.Neos:Test.RenderNodesDataStructure + } + """ + Then I expect the following Fusion rendering result: + """ + criteria: a1a2,a1a3 + """ + + Scenario: Siblings + When I execute the following Fusion code: + """fusion + test = Neos.Fusion:DataStructure { + noFilter = ${q(node).siblings().get()} + withFilter = ${q(node).siblings('[instanceof Neos.Neos:Test.DocumentType1]').get()} + @process.render = Neos.Neos:Test.RenderNodesDataStructure + } + """ + Then I expect the following Fusion rendering result: + """ + noFilter: a1a1,a1a2,a1a3,a1a5,a1a6,a1a7 + withFilter: a1a1,a1a7 + """ From 4854053ee61c3188e053db84ac69d7de5acd70e9 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Sat, 4 Nov 2023 17:52:59 +0100 Subject: [PATCH 2/2] TASK: Add test for `find` operation --- .../Behavior/Features/Fusion/FlowQuery.feature | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature index 10b618bfeee..2a8b9198d1f 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature @@ -312,3 +312,19 @@ Feature: Tests for the "Neos.ContentRepository" Flow Query methods. noFilter: a1a1,a1a2,a1a3,a1a5,a1a6,a1a7 withFilter: a1a1,a1a7 """ + + Scenario: Find + When the Fusion context node is "a1" + When I execute the following Fusion code: + """fusion + test = Neos.Fusion:DataStructure { + typeFilter = ${q(node).find('[instanceof Neos.Neos:Test.DocumentType2]').get()} + combinedFilter = ${q(node).find('[instanceof Neos.Neos:Test.DocumentType2][uriPathSegment*="b1"]').get()} + @process.render = Neos.Neos:Test.RenderNodesDataStructure + } + """ + Then I expect the following Fusion rendering result: + """ + typeFilter: a1a,a1b1a,a1a2,a1b2,a1a3,a1a4,a1a5,a1a6 + combinedFilter: a1b1a + """