Skip to content

Commit

Permalink
rename additional internal property
Browse files Browse the repository at this point in the history
Co-authored-by: Haroen Viaene <[email protected]>
  • Loading branch information
dhayab and Haroenv committed Apr 6, 2023
1 parent ccc3c5e commit 1296bc9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions packages/autocomplete-js/src/__tests__/requester.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":0}",
"{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":0}",
]
`);

Expand Down Expand Up @@ -304,7 +304,7 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"objectID\\":\\"7\\",\\"label\\":\\"Hit 7\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":4}",
"{\\"objectID\\":\\"7\\",\\"label\\":\\"Hit 7\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":4}",
]
`);

Expand All @@ -316,8 +316,8 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"objectID\\":\\"3\\",\\"label\\":\\"Hit 3\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":5}",
"{\\"objectID\\":\\"4\\",\\"label\\":\\"Hit 4\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":6}",
"{\\"objectID\\":\\"3\\",\\"label\\":\\"Hit 3\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":5}",
"{\\"objectID\\":\\"4\\",\\"label\\":\\"Hit 4\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":6}",
]
`);

Expand All @@ -331,7 +331,7 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"objectID\\":\\"5\\",\\"label\\":\\"Hit 5\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":7}",
"{\\"objectID\\":\\"5\\",\\"label\\":\\"Hit 5\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"},\\"__autocomplete_id\\":7}",
]
`);

Expand Down Expand Up @@ -561,7 +561,7 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"0\\":{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}},\\"hitsPerPage\\":20,\\"__autocomplete_id\\":0}",
"{\\"0\\":{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}},\\"hitsPerPage\\":20,\\"__autocomplete_id\\":0}",
]
`);

Expand Down Expand Up @@ -675,7 +675,7 @@ describe('requester', () => {
.map((node) => node.textContent)
).toMatchInlineSnapshot(`
Array [
"{\\"0\\":{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}},\\"results\\":[{\\"page\\":0,\\"hitsPerPage\\":20,\\"nbHits\\":1,\\"nbPages\\":1,\\"processingTimeMS\\":0,\\"hits\\":[{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaResultsMetadata\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}}],\\"query\\":\\"\\",\\"params\\":\\"\\",\\"exhaustiveNbHits\\":true,\\"exhaustiveFacetsCount\\":true}],\\"facetHits\\":[],\\"__autocomplete_id\\":0}",
"{\\"0\\":{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}},\\"results\\":[{\\"page\\":0,\\"hitsPerPage\\":20,\\"nbHits\\":1,\\"nbPages\\":1,\\"processingTimeMS\\":0,\\"hits\\":[{\\"objectID\\":\\"1\\",\\"label\\":\\"Hit 1\\",\\"__autocomplete_algoliaCredentials\\":{\\"appId\\":\\"algoliaAppId\\",\\"apiKey\\":\\"algoliaApiKey\\"}}],\\"query\\":\\"\\",\\"params\\":\\"\\",\\"exhaustiveNbHits\\":true,\\"exhaustiveFacetsCount\\":true}],\\"facetHits\\":[],\\"__autocomplete_id\\":0}",
]
`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type AlgoliaInsightsHit = {
objectID: string;
__autocomplete_indexName: string;
__autocomplete_queryID: string;
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId: string;
apiKey: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('fetchAlgoliaResults', () => {
{
objectID: '1',
label: 'Hit 1',
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId: 'algoliaAppId',
apiKey: 'algoliaApiKey',
},
Expand All @@ -82,7 +82,7 @@ describe('fetchAlgoliaResults', () => {
{
objectID: '2',
label: 'Hit 2',
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId: 'algoliaAppId',
apiKey: 'algoliaApiKey',
},
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('fetchAlgoliaResults', () => {
{
objectID: '1',
label: 'Hit 1',
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId: 'algoliaAppId',
apiKey: 'algoliaApiKey',
},
Expand All @@ -142,7 +142,7 @@ describe('fetchAlgoliaResults', () => {
{
objectID: '2',
label: 'Hit 2',
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId: 'algoliaAppId',
apiKey: 'algoliaApiKey',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function fetchAlgoliaResults<TRecord>({
...result,
hits: result.hits?.map((hit) => ({
...hit,
__autocomplete_algoliaResultsMetadata: {
__autocomplete_algoliaCredentials: {
appId,
apiKey,
},
Expand Down

0 comments on commit 1296bc9

Please sign in to comment.