Skip to content

Commit

Permalink
test(@dpc-sdp/ripple-tide-search): fixed search listing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdowdle committed Aug 2, 2023
1 parent d98939e commit 683c497
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,5 @@
},
"size": 10,
"from": 0,
"sort": [{ "_score": "desc" }, { "_doc": "desc" }],
"aggs": {
"audience": {
"terms": {
"field": "field_audience_name.keyword",
"order": { "_key": "asc" },
"size": 30
}
}
}
"sort": [{ "_score": "desc" }, { "_doc": "desc" }]
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,5 @@
{ "_score": "desc" },
{ "field_fv_recommendation_number": "asc" },
{ "_doc": "desc" }
],
"aggs": {
"category": {
"terms": {
"field": "field_fv_recommendation_category_name.keyword",
"order": { "_key": "asc" },
"size": 30
}
},
"department": {
"terms": {
"field": "field_fv_recommendation_dpt_name.keyword",
"order": { "_key": "asc" },
"size": 30
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { Then, When, DataTable } from '@badeball/cypress-cucumber-preprocessor'
Then(
'the search listing page should have {int} results',
(resultCount: number) => {
cy.get(`.rpl-result-listing-item`).should('have.length', resultCount)
cy.get(`[data-component-type="search-result"]`).should(
'have.length',
resultCount
)
}
)

Expand Down Expand Up @@ -75,7 +78,7 @@ Then(
const table = dataTable.hashes()

table.forEach((row, i: number) => {
cy.get(`.rpl-result-listing-item`)
cy.get(`[data-component-type="search-result"]`)
.eq(i)
.then((item) => {
cy.log(item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<li
v-for="(result, idx) in results"
:key="`result-${idx}-${result.id}`"
data-component-type="search-result"
class="tide-search-results-grid-item rpl-col-12 rpl-col-4-m"
>
<component :is="result.component" v-bind="result.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<RplResultListingItem
v-for="(result, idx) in results"
:key="`result-${idx}-${result.id}`"
data-component-type="search-result"
>
<component :is="result.component" v-bind="result.props" />
</RplResultListingItem>
Expand Down

0 comments on commit 683c497

Please sign in to comment.