Skip to content

Commit

Permalink
Merge pull request #4702 from mficzel/task/addBehatTestsForFlowQueryC…
Browse files Browse the repository at this point in the history
…rOperations

TASK: Add tests for FlowQuery `nextUntil`, `prevUntil`, `siblings` and `find`
  • Loading branch information
mhsdesign authored Nov 5, 2023
2 parents 5ae639f + 4854053 commit 3323e8a
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,60 @@ 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
"""

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
"""

0 comments on commit 3323e8a

Please sign in to comment.