From 76bbd6f43529f379c6556b7396cdc90aa636e8f7 Mon Sep 17 00:00:00 2001 From: David Featherston Date: Thu, 30 May 2024 11:43:09 +1000 Subject: [PATCH] test(nuxt-app): update grants listing test --- .../features/search-listing/grants.feature | 17 +++---- .../search-listing/grants/response.json | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/examples/nuxt-app/test/features/search-listing/grants.feature b/examples/nuxt-app/test/features/search-listing/grants.feature index c1d412ba6e..b03dc7ac4c 100644 --- a/examples/nuxt-app/test/features/search-listing/grants.feature +++ b/examples/nuxt-app/test/features/search-listing/grants.feature @@ -13,13 +13,14 @@ Feature: Grants collection 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" - Then the search listing page should have 2 results + Then the search listing page should have 3 results 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 | /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 | + | 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 | + | 2023 Coastcare Victoria Community Grants | https://www.marineandcoasts.vic.gov.au/coastcare-victoria-community-grants | Updated: 8 March 2023 | This year, Coastcare Victoria has $210,000 available for grants of up to $10,000 each. Projects will fit into one of three streams on offer including | Who can apply:Individuals, not-for-profit groups | $1 - $10,000 | Closed | @mockserver Example: Grant status filter - Open @@ -27,7 +28,7 @@ Feature: Grants collection 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 + Then the search listing page should have 3 results And the search network request should be called with the "/search-listing/grants/request-status-open" fixture @mockserver @@ -36,7 +37,7 @@ Feature: Grants collection 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 + Then the search listing page should have 3 results And the search network request should be called with the "/search-listing/grants/request-status-closed" fixture @mockserver @@ -45,7 +46,7 @@ Feature: Grants collection 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 + Then the search listing page should have 3 results And the search network request should be called with the "/search-listing/grants/request-status-ongoing" fixture @mockserver @@ -54,5 +55,5 @@ Feature: Grants collection 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 + Then the search listing page should have 3 results And the search network request should be called with the "/search-listing/grants/request-status-opening-soon" fixture diff --git a/examples/nuxt-app/test/fixtures/search-listing/grants/response.json b/examples/nuxt-app/test/fixtures/search-listing/grants/response.json index 1647d5818a..c620896947 100644 --- a/examples/nuxt-app/test/fixtures/search-listing/grants/response.json +++ b/examples/nuxt-app/test/fixtures/search-listing/grants/response.json @@ -140,6 +140,50 @@ "uuid": ["244b27ce-634c-4721-b70a-fea107b2ba9f"] }, "sort": [1.0, 3522] + }, + { + "_index": "a83890f7a31dea14e1ae83c6f0afacca--elasticsearch_index_production_node", + "_id": "entity:node/31026:en", + "_score": null, + "_ignored": ["field_landing_page_summary.keyword"], + "_source": { + "_language": "en", + "node_grants": ["node_access_all:0"], + "url": ["/site-4/2023-coastcare-victoria-community-grants"], + "changed": ["2023-03-08T10:26:00+11:00"], + "created": ["2023-03-07T11:24:06+11:00"], + "field_audience": [80, 82], + "field_audience_name": ["Individual", "Not-for-profit groups"], + "field_audience_uuid": [ + "f86a3a17-380b-4840-8d54-195260ac9db1", + "4038b20b-a519-4963-9cb6-04364cbe8eba" + ], + "field_landing_page_summary": [ + "This year, Coastcare Victoria has $210,000 available for grants of up to $10,000 each. Projects will fit into one of three streams on offer including ‘Stewardship and Education; Strengthening our Volunteer Groups; and Supporting Traditional Owner Self-Determination’." + ], + "field_node_dates_end_value": ["2023-03-30T11:00:00+11:00"], + "field_node_dates_start_value": ["2023-02-20T11:00:00+11:00"], + "field_node_link": [ + "https://www.marineandcoasts.vic.gov.au/coastcare-victoria-community-grants" + ], + "field_node_on_going": [false], + "field_node_primary_csite": [4], + "field_node_site": [4], + "field_topic": [11], + "field_topic_name": ["Environment, water \u0026 energy"], + "field_topic_path": ["/topic/environment-water-energy"], + "field_topic_uuid": ["56387cfe-be0a-4f5c-b3ca-f980a154699c"], + "funding_level_from": [1], + "funding_level_to": [10000], + "langcode": ["en"], + "nid": [31026], + "status": [true], + "title": ["2023 Coastcare Victoria Community Grants"], + "type": ["grant"], + "uid": [6087], + "uuid": ["e8022205-e15f-4231-ac38-49ed14328823"] + }, + "sort": [1.0, 3522] } ] },