Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Dec 18, 2024
1 parent a6a87fa commit 59db4c2
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test('hierarchical facets: using sortBy', async function () {

var algoliaResponse = {
results: [
// for hits
{
query: 'a',
index: indexName,
Expand All @@ -45,6 +46,7 @@ test('hierarchical facets: using sortBy', async function () {
'categories.lvl2': { 'beers > IPA > Flying dog': 1 },
},
},
// deepest level
{
query: 'a',
index: indexName,
Expand All @@ -54,15 +56,16 @@ test('hierarchical facets: using sortBy', async function () {
nbPages: 1,
hitsPerPage: 1,
facets: {
'categories.lvl0': { beers: 5 },
'categories.lvl1': { 'beers > IPA': 5 },
'categories.lvl0': { beers: 1 },
'categories.lvl1': { 'beers > IPA': 1 },
'categories.lvl2': {
'beers > IPA > Flying dog': 1,
'beers > IPA > Anchor steam': 1,
'beers > IPA > Brewdog punk IPA': 3,
},
},
},
// root level
{
query: 'a',
index: indexName,
Expand All @@ -75,6 +78,19 @@ test('hierarchical facets: using sortBy', async function () {
'categories.lvl0': { beers: 5 },
},
},
// other levels
{
query: 'a',
index: indexName,
hits: [{ objectID: 'one' }],
nbHits: 1,
page: 0,
nbPages: 1,
hitsPerPage: 1,
facets: {
'categories.lvl1': { 'beers > IPA': 5 },
},
},
],
};

Expand All @@ -91,7 +107,6 @@ test('hierarchical facets: using sortBy', async function () {
name: 'beers',
path: 'beers',
escapedValue: 'beers',
// is this not a bit weird??
count: 5,
isRefined: true,
exhaustive: true,
Expand All @@ -100,8 +115,7 @@ test('hierarchical facets: using sortBy', async function () {
name: 'IPA',
path: 'beers > IPA',
escapedValue: 'beers > IPA',
// this too?
count: 1,
count: 5,
isRefined: true,
exhaustive: true,
data: [
Expand Down

0 comments on commit 59db4c2

Please sign in to comment.