-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1222 from dpc-sdp/feature/skeleton-loading
[R20-1969] skeleton loading
- Loading branch information
Showing
38 changed files
with
1,259 additions
and
80 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
examples/nuxt-app/components/global/TideSearchResultExampleSkeleton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div class="tide-search-results-example-skeleton"> | ||
<RplSkeleton width="m" class="rpl-u-aspect-panorama" /> | ||
<RplSkeleton width="full" class="rpl-u-margin-t-2 rpl-type-p" /> | ||
<RplSkeleton width="s" class="rpl-u-margin-t-1 rpl-type-p" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
examples/nuxt-app/test/features/search-listing/grid-list.feature
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
examples/nuxt-app/test/features/search-listing/grid.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Feature: Grid layout | ||
|
||
As a site I can see a collection of links to other pages in a grid and interact with it to find the one I want. | ||
|
||
Background: | ||
Given the site endpoint 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: Results are display in a grid format with default skeleton loader | ||
Given the page endpoint for path "/search-grid" returns fixture "/search-listing/grid/page" with status 200 | ||
And the search network request is stubbed with fixture "/search-listing/grid/response", status 200 and delayed by 400 milliseconds | ||
When I visit the page "/search-grid" | ||
Then the search listing skeleton should display 9 items with the class "tide-search-result-card-skeleton" | ||
|
||
When I wait 500 milliseconds | ||
Then the search listing page should have 9 results | ||
Then the search listing layout should be "grid" | ||
And the search network request should be called with the "/search-listing/grid/request" fixture | ||
And the search listing results count should read "Displaying 1-9 of 55 results" | ||
And the search listing results should have following items: | ||
| title | content | component | | ||
| Strategy for Aboriginal Community-led Recovery | The Strategy for Aboriginal Community-led Recovery | tide-search-result-card | | ||
| Emergency Recovery Victoria - Recovery Framework | This recovery framework provides a consistent and community-led approach | tide-search-result-card | | ||
| Community Recovery Toolkit | This toolkit provides practical advice on recovery processes, approaches, and tools | tide-search-result-card | | ||
|
||
@mockserver | ||
Example: A custom skeleton loader can be use for grid result items | ||
Given I load the page fixture with "/search-listing/grid/page" | ||
And the search listing result skeleton is set to the "TideSearchResultExampleSkeleton" component | ||
And the search network request is stubbed with fixture "/search-listing/grid/response", status 200 and delayed by 400 milliseconds | ||
Then the page endpoint for path "/search-grid" returns the loaded fixture | ||
|
||
When I visit the page "/search-grid" | ||
Then the search listing skeleton should display 9 items with the class "tide-search-results-example-skeleton" |
36 changes: 36 additions & 0 deletions
36
examples/nuxt-app/test/features/search-listing/list.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Feature: List layout | ||
|
||
As a site I can see a collection of links to other pages in a list format | ||
|
||
Background: | ||
Given the site endpoint 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: Results are displayed in a list with default skeleton loader | ||
Given the page endpoint for path "/search-list" returns fixture "/search-listing/list/page" with status 200 | ||
And the search network request is stubbed with fixture "/search-listing/list/response", status 200 and delayed by 400 milliseconds | ||
When I visit the page "/search-list" | ||
Then the search listing skeleton should display 9 items with the class "tide-search-result-skeleton" | ||
|
||
When I wait 500 milliseconds | ||
Then the search listing page should have 3 results | ||
Then the search listing layout should be "list" | ||
And the search network request should be called with the "/search-listing/list/request" fixture | ||
And the search listing results count should read "Displaying 1-9 of 124 results" | ||
And the search listing results should have following items: | ||
| title | content | component | | ||
| 2-BE-event-1 | The ingenious hero who travelled far and wide | tide-search-result | | ||
| 5-BE-land-3 Landing Page | Outside thundered the approaching surf of war | tide-search-result | | ||
| Accessibility - demo | Accessibility information about this website. | tide-search-result | | ||
|
||
@mockserver | ||
Example: A custom skeleton loader can be use for list result items | ||
Given I load the page fixture with "/search-listing/list/page" | ||
And the search listing result skeleton is set to the "TideSearchResultExampleSkeleton" component | ||
And the search network request is stubbed with fixture "/search-listing/list/response", status 200 and delayed by 400 milliseconds | ||
Then the page endpoint for path "/search-list" returns the loaded fixture | ||
|
||
When I visit the page "/search-list" | ||
Then the search listing skeleton should display 9 items with the class "tide-search-results-example-skeleton" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
] | ||
} | ||
}, | ||
"results": { | ||
"resultsConfig": { | ||
"layout": { | ||
"component": "TideSearchResultsGrid" | ||
}, | ||
|
69 changes: 69 additions & 0 deletions
69
examples/nuxt-app/test/fixtures/search-listing/list/page.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"title": "Search listing list", | ||
"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": "Minim cillum dolore dolore laborum minim.", | ||
"config": { | ||
"searchListingConfig": { | ||
"resultsPerPage": 9 | ||
}, | ||
"queryConfig": { | ||
"multi_match": { | ||
"query": "{{query}}", | ||
"fields": [ | ||
"title^3", | ||
"field_landing_page_summary^2", | ||
"body", | ||
"field_paragraph_body", | ||
"summary_processed" | ||
] | ||
} | ||
}, | ||
"resultsConfig": { | ||
"layout": { | ||
"component": "TideSearchResultsList" | ||
}, | ||
"item": { | ||
"*": { | ||
"component": "TideSearchResult" | ||
} | ||
} | ||
}, | ||
"globalFilters": [ | ||
{ "terms": { "type": ["landing_page", "event"] } }, | ||
{ "terms": { "field_node_site": [8888] } } | ||
], | ||
"userFilters": [ | ||
{ | ||
"id": "type", | ||
"component": "TideSearchFilterDropdown", | ||
"filter": { | ||
"type": "type", | ||
"value": "type.keyword" | ||
}, | ||
"props": { | ||
"id": "type", | ||
"label": "Type", | ||
"placeholder": "Select a type", | ||
"type": "RplFormDropdown", | ||
"multiple": true, | ||
"options": [ | ||
{ | ||
"id": "landing_page", | ||
"label": "Page", | ||
"value": "Page" | ||
}, | ||
{ | ||
"id": "event", | ||
"label": "Event", | ||
"value": "Event" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
examples/nuxt-app/test/fixtures/search-listing/list/request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"query": { | ||
"bool": { | ||
"must": [{ "match_all": {} }], | ||
"filter": [ | ||
{ "terms": { "type": ["landing_page", "event"] } }, | ||
{ "terms": { "field_node_site": [8888] } } | ||
] | ||
} | ||
}, | ||
"size": 9, | ||
"from": 0, | ||
"sort": [{ "_score": "desc" }, { "_doc": "desc" }] | ||
} |
Oops, something went wrong.