1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/tests/unit/algolia/rank.js
Kevin Heis 2fb2e962bc Move site search to use an endpoint (#17359)
* Move site search to use an endpoint

* Update browser.js

* Update search.js

* Update lib/search/versions.js

Co-authored-by: James M. Greene <JamesMGreene@github.com>

* Fix URLs

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-01-20 15:37:42 +00:00

16 lines
564 B
JavaScript

const rank = require('../../../lib/search/rank')
test('search custom rankings', () => {
const expectedRankings = [
['https://docs.github.com/en/github/actions', 3],
['https://docs.github.com/en/rest/reference', 2],
['https://docs.github.com/en/graphql', 1],
['https://docs.github.com/en/github/site-policy', 0]
]
expectedRankings.forEach(([url, expectedRanking]) => {
const expectationMessage = `expected ${url} to have a custom ranking of ${expectedRanking}`
expect(rank({ url }), expectationMessage).toBe(expectedRanking)
})
})