Skip to content

Commit

Permalink
Merge branch 'develop' into feature/nuxt-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly authored Jan 12, 2024
2 parents 4678b2a + 200afb8 commit e70e098
Show file tree
Hide file tree
Showing 17 changed files with 715 additions and 26 deletions.
39 changes: 38 additions & 1 deletion examples/nuxt-app/test/features/search-listing/filters.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Feature: Search listing - Filter
When I toggle the search listing filters section
Then the search listing dropdown field labelled "Raw filter example" should have the value "Dogs, Birds"


@mockserver
Example: Term filter - Should reflect a single value from the URL
Given the page endpoint for path "/filters" returns fixture "/search-listing/filters/page" with status 200
Expand Down Expand Up @@ -177,6 +176,44 @@ Feature: Search listing - Filter
| Apples |
| Oranges |

@mockserver
Example: Dependent filter - Should reflect the value from the URL
Given the page endpoint for path "/filters" returns fixture "/search-listing/dependent-filters/page" with status 200
And the search network request is stubbed with fixture "/search-listing/dependent-filters/response" and status 200

When I visit the page "/filters?dependentFilter=Mammals:Dogs,Cats"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request" fixture
Then the filters toggle should show 2 applied filters

When I toggle the search listing filters section
Then the search listing dropdown field labelled "Terms dependent example" should have the value "Mammals"
Then the search listing dropdown field labelled "Terms dependent child example" should have the value "Dogs, Cats"
When I click the search listing dropdown field labelled "Terms dependent example"
Then the selected dropdown field should have the items:
| Mammals |
| Birds |
When I click the search listing dropdown field labelled "Terms dependent child example"
Then the selected dropdown field should have the items:
| Dogs |
| Cats |

@mockserver
Example: Dependent filter - Child options should update on parent selection
Given the page endpoint for path "/filters" returns fixture "/search-listing/dependent-filters/page" with status 200
And the search network request is stubbed with fixture "/search-listing/dependent-filters/response" and status 200
When I visit the page "/filters"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-empty" fixture

When I toggle the search listing filters section
And I click the search listing dropdown field labelled "Terms dependent example"
Then I click the option labelled "Birds" in the selected dropdown
And I click the search listing dropdown field labelled "Terms dependent child example"
Then the selected dropdown field should have the items:
| Parrot |
| Cockatoo |

@mockserver
Example: Should hide the search form when hideSearchForm is set
Given the page endpoint for path "/no-search-form" returns fixture "/search-listing/filters/page-no-search-form" with status 200
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"title": "Depenedent filters",
"changed": "2022-11-02T12:47:29+11:00",
"created": "2022-11-02T12:47:29+11:00",
"type": "tide_search_listing",
"nid": "11dede11-10c0-111e1-1100-000000000330",
"showTopicTags": true,
"summary": "",
"config": {
"searchListingConfig": {
"resultsPerPage": 10
},
"queryConfig": {
"multi_match": {
"query": "{{query}}",
"fields": [
"title^3",
"field_landing_page_summary^2",
"body",
"field_paragraph_body",
"summary_processed"
]
}
},
"results": {
"layout": {
"component": "TideSearchResultsList"
},
"item": {
"grant": {
"component": "TideGrantSearchResult"
}
}
},
"globalFilters": [
{ "terms": { "type": ["grant"] } },
{ "terms": { "field_node_site": [8888] } }
],
"userFilters": [
{
"id": "termFilter",
"component": "TideSearchFilterDropdown",
"filter": {
"type": "term",
"value": "termFilter.keyword"
},
"aggregations": {
"field": "termFilter",
"source": "taxonomy"
},
"props": {
"id": "termFilter",
"label": "Term filter example",
"placeholder": "Select a colour",
"multiple": true,
"options": [
{
"id": "1",
"label": "Red",
"value": "Red"
},
{
"id": "2",
"label": "Green",
"value": "Green"
},
{
"id": "3",
"label": "Blue",
"value": "Blue"
}
]
}
},
{
"id": "termsFilter",
"component": "TideSearchFilterDropdown",
"filter": {
"type": "terms",
"value": "termsFilter.keyword"
},
"aggregations": {
"field": "termsFilter",
"source": "taxonomy"
},
"props": {
"id": "termsFilter",
"label": "Terms filter example",
"placeholder": "Select a colour",
"multiple": true,
"options": [
{
"id": "1",
"label": "Orange",
"value": "Orange"
},
{
"id": "2",
"label": "Purple",
"value": "Purple"
},
{
"id": "3",
"label": "Yellow",
"value": "Yellow"
}
]
}
},
{
"id": "dependentFilter",
"component": "TideSearchFilterDependent",
"columns": "rpl-grid",
"filter": {
"type": "dependent",
"multiple": false,
"value": "field_species_name"
},
"aggregations": {
"field": "topic",
"source": "taxonomy"
},
"props": {
"id": "dependentFilter",
"label": "Terms dependent example",
"placeholder": "Select a species",
"dependantLabel": "Terms dependent child example",
"dependantPlaceholder": "All sub species",
"multiple": true,
"options": [
{
"id": "1",
"label": "Mammals",
"value": "Mammals"
},
{
"id": "2",
"label": "Dogs",
"value": "Dogs",
"parent": "1"
},
{
"id": "3",
"label": "Birds",
"value": "Birds"
},
{
"id": "4",
"label": "Cats",
"value": "Cats",
"parent": "1"
},
{
"id": "5",
"label": "Parrot",
"value": "Parrot",
"parent": "3"
},
{
"id": "6",
"label": "Cockatoo",
"value": "Cockatoo",
"parent": "3"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
],
"filter": [
{
"terms": {
"type": ["grant"]
}
},
{
"terms": {
"field_node_site": [8888]
}
},
null
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"_score": "desc"
},
{
"_doc": "desc"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
],
"filter": [
{
"terms": {
"type": ["grant"]
}
},
{
"terms": {
"field_node_site": [8888]
}
},
{
"terms": {
"field_species_name": ["Dogs", "Cats"]
}
}
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"_score": "desc"
},
{
"_doc": "desc"
}
]
}
Loading

0 comments on commit e70e098

Please sign in to comment.