Skip to content

Commit

Permalink
fix(insights): show docs URL when is missing. (#4231)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrugg committed Dec 3, 2019
1 parent 50f4af3 commit 9df1e7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/lib/__tests__/insights-client-test.ts
Expand Up @@ -260,9 +260,11 @@ describe('withInsights', () => {
objectIDs: ['1', '2'],
eventName: 'Add to basket',
});
}).toThrowErrorMatchingInlineSnapshot(
`"Could not infer \`queryID\`. Ensure InstantSearch is configured with \`clickAnalytics: true\`"`
);
}).toThrowErrorMatchingInlineSnapshot(`
"Could not infer \`queryID\`. Ensure InstantSearch \`clickAnalytics: true\` was added with the Configure widget.
See: https://alg.li/lNiZZ7"
`);
});

it('should reject unknown method name', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/insights/client.ts
Expand Up @@ -34,7 +34,9 @@ const getQueryID = (selectedHits: Hits): string => {
const queryID = queryIDs[0];
if (typeof queryID !== 'string') {
throw new Error(
'Could not infer `queryID`. Ensure InstantSearch is configured with `clickAnalytics: true`'
`Could not infer \`queryID\`. Ensure InstantSearch \`clickAnalytics: true\` was added with the Configure widget.
See: https://alg.li/lNiZZ7`
);
}
return queryID;
Expand Down

0 comments on commit 9df1e7f

Please sign in to comment.