Skip to content

Commit

Permalink
Merge branch 'develop' into feature/R20-1312-topic-listing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdowdle authored Jul 27, 2023
2 parents b4a1a4b + 97f04cd commit 698a8da
Show file tree
Hide file tree
Showing 38 changed files with 622 additions and 593 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defaults: &defaults
- image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
environment:
TERM: xterm
TZ: 'Australia/Melbourne'
TZ: "Australia/Melbourne"
NUXT_PUBLIC_API_URL: http://localhost:3001
auth:
username: $DOCKERHUB_USERNAME
Expand Down Expand Up @@ -269,7 +269,8 @@ jobs:
pnpm release:publish --yes
update-reference:
<<: *defaults
docker:
- image: cimg/node:18.17.0
steps:
- run:
name: Kick off new pipeline
Expand Down
59 changes: 40 additions & 19 deletions examples/nuxt-app/test/features/search-listing/grants.feature
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Feature: Grants collection

As a site I can see a collection of links to other pages and interact with it find the one I want.
As a user I can search for grants and filter them by status

Background:
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture
And I am using a "macbook-16" device

@mockserver
Example: Grants
Example: Results formatting
Given the endpoint "/api/tide/page" with query "?path=/grants&site=8888" returns fixture "/search-listing/grants/page" with status 200
And the search network request is stubbed with fixture "/search-listing/grants/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
Expand All @@ -17,21 +17,42 @@ Feature: Grants collection
And the search listing layout should be "list"
And the search network request should be called with the "/search-listing/grants/request" fixture
And the grant search listing results should have following items:
| title | url | updated | content | audience | amount | status |
| THIS IS A TEST | /site-8888/tc-9b-grant-page-closed | Updated: 2023-05-09T15:00:46+10:00 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Business | $11,326 - $26,494 | Closed |
| TC-9a Grant Simple Test - Date Range | /site-8888/tc-9a-grant-simple-test-date-range | Updated: 2023-05-09T15:00:46+10:00 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Not-for-profit groups, government | $11,326 - $26,494 | Open, closing in 163 days |
| title | url | updated | content | audience | amount | status |
| THIS IS A TEST | /tc-9b-grant-page-closed | Updated: 9 May 2023 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Business | $11,326 - $26,494 | Closed |
| TC-9a Grant Simple Test - Date Range | /tc-9a-grant-simple-test-date-range | Updated: 9 May 2023 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus. | Not-for-profit groups, government | $11,326 - $26,494 | Open, closing in 163 days |

When I toggle the search listing filters section
When I click the search listing dropdown field labelled "View those relevant to me"
# First item is hardcoded, the rest come from ES aggregation
Then the selected dropdown field should have the items:
| Hard coded |
| Business |
| Government |
| Individual |
| Not-for-profit groups |
When I click the search listing dropdown field labelled "Grant or program topic"
# These come from Tide page API response
Then the selected dropdown field should have the items:
| Arts |
| Business |
@mockserver
Example: Grant status filter - Open
Given the endpoint "/api/tide/page" with query "?path=/grants&site=8888" returns fixture "/search-listing/grants/page" with status 200
And the search network request is stubbed with fixture "/search-listing/grants/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/grants?status=open"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/grants/request-status-open" fixture

@mockserver
Example: Grant status filter - Closed
Given the endpoint "/api/tide/page" with query "?path=/grants&site=8888" returns fixture "/search-listing/grants/page" with status 200
And the search network request is stubbed with fixture "/search-listing/grants/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/grants?status=closed"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/grants/request-status-closed" fixture

@mockserver
Example: Grant status filter - Ongoing
Given the endpoint "/api/tide/page" with query "?path=/grants&site=8888" returns fixture "/search-listing/grants/page" with status 200
And the search network request is stubbed with fixture "/search-listing/grants/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/grants?status=ongoing"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/grants/request-status-ongoing" fixture

@mockserver
Example: Grant status filter - Opening soon
Given the endpoint "/api/tide/page" with query "?path=/grants&site=8888" returns fixture "/search-listing/grants/page" with status 200
And the search network request is stubbed with fixture "/search-listing/grants/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"
When I visit the page "/grants?status=opening_soon"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/grants/request-status-opening-soon" fixture
121 changes: 95 additions & 26 deletions examples/nuxt-app/test/fixtures/search-listing/grants/page.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
{
"title": "Grants and programs",
"changed": "2022-11-02T12:47:29+11:00",
"created": "2022-11-02T12:47:29+11:00",
"changed": "2023-07-25T01:21:48+00:00",
"created": "2023-07-25T01:21:23+00:00",
"type": "tide_search_listing",
"nid": "11dede11-10c0-111e1-1100-000000000330",
"showTopicTags": true,
"summary": "",
"nid": "a8438744-43b0-4777-b558-0c69f3ff1d21",
"sidebar": {},
"status": "published",
"topicTags": [
{
"url": ""
}
],
"siteSection": null,
"meta": {
"langcode": "en",
"description": "",
"additional": [
{
"tag": "meta",
"attributes": {
"name": "title",
"content": "Grants and programs | Victorian Government"
}
},
{
"tag": "link",
"attributes": {
"rel": "canonical",
"href": "https://nginx-php.pr-1554.content-vic.sdp4.sdp.vic.gov.au/grants"
}
}
],
"keywords": "",
"image": null
},
"showContentRating": true,
"summary": null,
"searchListingConfig": {
"resultsPerPage": 10
"resultsPerPage": 10,
"labels": {
"submit": "Search all grants and programs",
"placeholder": "Search all grants and programs"
},
"customSort": [
{
"title.keyword": "asc"
}
]
},
"index": "a83890f7a31dea14e1ae83c6f0afacca-appsearch-index-default-node",
"queryConfig": {
"multi_match": {
"query": "{{query}}",
Expand All @@ -21,6 +61,18 @@
]
}
},
"globalFilters": [
{
"terms": {
"type": ["grant"]
}
},
{
"terms": {
"field_node_site": [4]
}
}
],
"results": {
"layout": {
"component": "TideSearchResultsList"
Expand All @@ -31,33 +83,44 @@
}
}
},
"globalFilters": [
{ "terms": { "type": ["grant"] } },
{ "terms": { "field_node_site": [8888] } }
],
"userFilters": [
{
"id": "audience",
"component": "TideSearchFilterDropdown",
"filter": {
"type": "terms",
"value": "field_audience_name.keyword"
"value": "field_audience_name"
},
"aggregations": {
"field": "field_audience_name.keyword",
"source": "elastic"
"field": "audience",
"source": "taxonomy"
},
"props": {
"id": "audience",
"label": "View those relevant to me",
"label": "View those relevant to",
"placeholder": "Individuals and organisation types",
"type": "RplFormDropdown",
"multiple": true,
"options": [
{
"id": "1",
"label": "Hard coded",
"value": "Hard coded"
"id": 8918,
"label": "Individual",
"value": "Individual"
},
{
"id": 8920,
"label": "Government",
"value": "Government"
},
{
"id": 8921,
"label": "Not-for-profit groups",
"value": "Not-for-profit groups"
},
{
"id": 8919,
"label": "Business",
"value": "Business"
}
]
}
Expand All @@ -76,19 +139,24 @@
"props": {
"id": "topic",
"label": "Grant or program topic",
"placeholder": "Grant topic",
"placeholder": "Please select",
"type": "RplFormDropdown",
"multiple": true,
"options": [
{
"id": "1",
"label": "Arts",
"value": "Arts"
"id": 1,
"label": "Arts, culture & heritage",
"value": "Arts, culture & heritage"
},
{
"id": "2",
"label": "Business",
"value": "Business"
"id": 2,
"label": "Business & the workplace",
"value": "Business & the workplace"
},
{
"id": 3,
"label": "Communities",
"value": "Communities"
}
]
}
Expand All @@ -102,7 +170,7 @@
},
"props": {
"id": "status",
"label": "Status",
"label": "Grant or program topic",
"placeholder": "Select for opened, closed or upcoming grants",
"type": "RplFormDropdown",
"multiple": true,
Expand Down Expand Up @@ -130,5 +198,6 @@
]
}
}
]
],
"_fetched": 1690260404545
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"query": {
"bool": {
"must": [{ "match_all": {} }],
"filter": [
{ "terms": { "type": ["grant"] } },
{ "terms": { "field_node_site": [4] } },
{
"bool": {
"should": [
{
"range": {
"field_node_dates_end_value": {
"lte": "now"
}
}
}
]
}
}
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"title.keyword": "asc"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"query": {
"bool": {
"must": [{ "match_all": {} }],
"filter": [
{ "terms": { "type": ["grant"] } },
{ "terms": { "field_node_site": [4] } },
{
"bool": {
"should": [
{
"term": {
"field_node_on_going": "true"
}
}
]
}
}
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"title.keyword": "asc"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"query": {
"bool": {
"must": [{ "match_all": {} }],
"filter": [
{ "terms": { "type": ["grant"] } },
{ "terms": { "field_node_site": [4] } },
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"range": {
"field_node_dates_start_value": {
"lte": "now"
}
}
},
{
"range": {
"field_node_dates_end_value": {
"gte": "now"
}
}
}
]
}
}
]
}
}
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"title.keyword": "asc"
}
]
}
Loading

0 comments on commit 698a8da

Please sign in to comment.