Skip to content

Commit

Permalink
fix(insights): bump embedded search-insights version (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab committed Apr 24, 2023
1 parent 0d0c843 commit 984d9c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('createAlgoliaInsightsPlugin', () => {
expect(document.body).toMatchInlineSnapshot(`
<body>
<script
src="https://cdn.jsdelivr.net/npm/search-insights@2.4.0/dist/search-insights.min.js"
src="https://cdn.jsdelivr.net/npm/search-insights@2.6.0/dist/search-insights.min.js"
/>
<form>
<input />
Expand All @@ -243,7 +243,7 @@ describe('createAlgoliaInsightsPlugin', () => {
`);
expect((window as any).AlgoliaAnalyticsObject).toBe('aa');
expect((window as any).aa).toEqual(expect.any(Function));
expect((window as any).aa.version).toBe('2.4.0');
expect((window as any).aa.version).toBe('2.6.0');
});

it('notifies when the script fails to be added', () => {
Expand Down Expand Up @@ -736,7 +736,7 @@ describe('createAlgoliaInsightsPlugin', () => {
test('sends a `clickedObjectIDsAfterSearch` event with additional parameters if client supports it', async () => {
const insightsClient = jest.fn();
// @ts-ignore
insightsClient.version = '2.4.0';
insightsClient.version = '2.6.0';
const insightsPlugin = createAlgoliaInsightsPlugin({ insightsClient });

const { inputElement } = createPlayground(createAutocomplete, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from './types';

const VIEW_EVENT_DELAY = 400;
const ALGOLIA_INSIGHTS_VERSION = '2.4.0';
const ALGOLIA_INSIGHTS_VERSION = '2.6.0';
const ALGOLIA_INSIGHTS_SRC = `https://cdn.jsdelivr.net/npm/search-insights@${ALGOLIA_INSIGHTS_VERSION}/dist/search-insights.min.js`;

type SendViewedObjectIDsParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
'X-Algolia-API-Key': apiKey,
};

searchInsights(method, ...payloads, { headers } as any);
searchInsights(method, ...payloads, { headers });
} else {
searchInsights(method, ...payloads);
}
Expand Down

0 comments on commit 984d9c5

Please sign in to comment.