diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index 248002cd..44788c8d 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -62,7 +62,7 @@ SOFTWARE. The following NPM package may be included in this product: - - @yext/search-core@2.0.0-alpha.215 + - @yext/search-core@2.0.0-alpha.218 This package contains the following license and notice below: diff --git a/docs/search-headless.answersconfig.md b/docs/search-headless.answersconfig.md deleted file mode 100644 index 3642f101..00000000 --- a/docs/search-headless.answersconfig.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfig](./search-headless.answersconfig.md) - -## AnswersConfig type - -> Warning: This API is now obsolete. -> -> AnswersConfig is deprecated and has been replaced by [SearchConfig](./search-headless.searchconfig.md) -> - -Signature: - -```typescript -export declare type AnswersConfig = SearchConfig; -``` -References: [SearchConfig](./search-headless.searchconfig.md) - diff --git a/docs/search-headless.answersconfigwithapikey.md b/docs/search-headless.answersconfigwithapikey.md deleted file mode 100644 index 70b3d3f1..00000000 --- a/docs/search-headless.answersconfigwithapikey.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) - -## AnswersConfigWithApiKey interface - -> Warning: This API is now obsolete. -> -> AnswersConfigWithApiKey is deprecated and has been replaced by [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) -> - -Signature: - -```typescript -export declare interface AnswersConfigWithApiKey extends SearchConfigWithApiKey -``` -Extends: [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) - diff --git a/docs/search-headless.answersconfigwithtoken.md b/docs/search-headless.answersconfigwithtoken.md deleted file mode 100644 index dd00b76a..00000000 --- a/docs/search-headless.answersconfigwithtoken.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) - -## AnswersConfigWithToken interface - -> Warning: This API is now obsolete. -> -> AnswersConfigWithToken is deprecated and has been replaced by [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) -> - -Signature: - -```typescript -export declare interface AnswersConfigWithToken extends SearchConfigWithToken -``` -Extends: [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) - diff --git a/docs/search-headless.answerscore.md b/docs/search-headless.answerscore.md deleted file mode 100644 index 8d9b67af..00000000 --- a/docs/search-headless.answerscore.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) - -## AnswersCore class - -> Warning: This API is now obsolete. -> -> AnswersCore is deprecated and has been replaced by [SearchCore](./search-headless.searchcore.md) -> - -Signature: - -```typescript -export declare class AnswersCore extends SearchCore -``` -Extends: [SearchCore](./search-headless.searchcore.md) - diff --git a/docs/search-headless.answerserror.md b/docs/search-headless.answerserror.md deleted file mode 100644 index c6aa99a6..00000000 --- a/docs/search-headless.answerserror.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersError](./search-headless.answerserror.md) - -## AnswersError interface - -> Warning: This API is now obsolete. -> -> AnswersError is deprecated and has been replaced by [SearchError](./search-headless.searcherror.md) -> - -Signature: - -```typescript -export declare interface AnswersError extends SearchError -``` -Extends: [SearchError](./search-headless.searcherror.md) - diff --git a/docs/search-headless.answersheadless.md b/docs/search-headless.answersheadless.md deleted file mode 100644 index a8b46f09..00000000 --- a/docs/search-headless.answersheadless.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersHeadless](./search-headless.answersheadless.md) - -## AnswersHeadless class - -> Warning: This API is now obsolete. -> -> AnswersHeadless has been deprecated and renamed to SearchHeadless -> - -Signature: - -```typescript -export declare class AnswersHeadless extends SearchHeadless -``` -Extends: SearchHeadless - diff --git a/docs/search-headless.answersrequest.md b/docs/search-headless.answersrequest.md deleted file mode 100644 index ef1f1198..00000000 --- a/docs/search-headless.answersrequest.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersRequest](./search-headless.answersrequest.md) - -## AnswersRequest interface - -> Warning: This API is now obsolete. -> -> AnswersRequest is deprecated and has been replaced by [SearchRequest](./search-headless.searchrequest.md) -> - -Signature: - -```typescript -export declare interface AnswersRequest extends SearchRequest -``` -Extends: [SearchRequest](./search-headless.searchrequest.md) - diff --git a/docs/search-headless.answersutilities.md b/docs/search-headless.answersutilities.md deleted file mode 100644 index 9cb135ba..00000000 --- a/docs/search-headless.answersutilities.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [answersUtilities](./search-headless.answersutilities.md) - -## answersUtilities namespace - -> Warning: This API is now obsolete. -> -> answersUtilities has been deprecated and renamed to searchUtilities -> - -Signature: - -```typescript -export declare namespace answersUtilities -``` diff --git a/docs/search-headless.baseanswersconfig.md b/docs/search-headless.baseanswersconfig.md deleted file mode 100644 index cf0a755f..00000000 --- a/docs/search-headless.baseanswersconfig.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) - -## BaseAnswersConfig interface - -> Warning: This API is now obsolete. -> -> BaseAnswersConfig is deprecated and has been replaced by [BaseSearchConfig](./search-headless.basesearchconfig.md) -> - -Signature: - -```typescript -export declare interface BaseAnswersConfig extends BaseSearchConfig -``` -Extends: [BaseSearchConfig](./search-headless.basesearchconfig.md) - diff --git a/docs/search-headless.basesearchconfig.additionalqueryparams.md b/docs/search-headless.basesearchconfig.additionalqueryparams.md new file mode 100644 index 00000000..c3d44975 --- /dev/null +++ b/docs/search-headless.basesearchconfig.additionalqueryparams.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [additionalQueryParams](./search-headless.basesearchconfig.additionalqueryparams.md) + +## BaseSearchConfig.additionalQueryParams property + +Additional query params added on to every request. + +Signature: + +```typescript +additionalQueryParams?: { + [key: string]: string | number | boolean; + }; +``` diff --git a/docs/search-headless.basesearchconfig.md b/docs/search-headless.basesearchconfig.md index 41211133..9536ecfb 100644 --- a/docs/search-headless.basesearchconfig.md +++ b/docs/search-headless.basesearchconfig.md @@ -16,6 +16,7 @@ export declare interface BaseSearchConfig | Property | Type | Description | | --- | --- | --- | +| [additionalQueryParams?](./search-headless.basesearchconfig.additionalqueryparams.md) | { \[key: string\]: string \| number \| boolean; } | (Optional) Additional query params added on to every request. | | [endpoints?](./search-headless.basesearchconfig.endpoints.md) | [Endpoints](./search-headless.endpoints.md) | (Optional) Overrides for the URLs which are used when making requests to the Search API. | | [experienceKey](./search-headless.basesearchconfig.experiencekey.md) | string | The experience key of the search experience. | | [experienceVersion?](./search-headless.basesearchconfig.experienceversion.md) | 'STAGING' \| 'PRODUCTION' \| string \| number | (Optional) The version of the search experience configuration. | diff --git a/docs/search-headless.md b/docs/search-headless.md index 0ce32ed8..c8828db3 100644 --- a/docs/search-headless.md +++ b/docs/search-headless.md @@ -8,8 +8,6 @@ | Class | Description | | --- | --- | -| [AnswersCore](./search-headless.answerscore.md) | | -| [AnswersHeadless](./search-headless.answersheadless.md) | | | [SearchCore](./search-headless.searchcore.md) | Provides methods for executing searches, submitting questions, and performing autocompletes. | | [SearchError](./search-headless.searcherror.md) | Represents an error | | [SearchHeadless](./search-headless.searchheadless.md) | Provides the functionality for interacting with a Search experience. | @@ -54,15 +52,10 @@ | [AddressDirectAnswer](./search-headless.addressdirectanswer.md) | A [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) interface with 'address' field type. | | [AllResultsForVertical](./search-headless.allresultsforvertical.md) | Represents all results for the current vertical. | | [AndroidAppUrlDirectAnswer](./search-headless.androidappurldirectanswer.md) | A direct answer for an android app url field. | -| [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) | | -| [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) | | -| [AnswersError](./search-headless.answerserror.md) | | -| [AnswersRequest](./search-headless.answersrequest.md) | | | [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) | A filter that the Search API applied to the search. | | [AutocompleteResponse](./search-headless.autocompleteresponse.md) | The response of a universal or vertical autocomplete request. | | [AutocompleteResult](./search-headless.autocompleteresult.md) | An autocomplete suggestion. | | [AutocompleteService](./search-headless.autocompleteservice.md) | A service for autocomplete requests. | -| [BaseAnswersConfig](./search-headless.baseanswersconfig.md) | | | [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) | A direct answer which was found within a document. | | [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) | A direct answer where the answer came from a field from the knowledge graph. | | [BaseSearchConfig](./search-headless.basesearchconfig.md) | The base configuration options for [SearchCore](./search-headless.searchcore.md). | @@ -150,7 +143,6 @@ | Namespace | Description | | --- | --- | -| [answersUtilities](./search-headless.answersutilities.md) | | | [searchUtilities](./search-headless.searchutilities.md) | | ## Variables @@ -158,14 +150,12 @@ | Variable | Description | | --- | --- | | [DEFAULT\_HEADLESS\_ID](./search-headless.default_headless_id.md) | The headlessId automatically given to the first SearchHeadless instance created. | -| [provideAnswersHeadless](./search-headless.provideanswersheadless.md) | Supplies a new instance of [SearchHeadless](./search-headless.searchheadless.md), using the provided configuration. | | [SandboxEndpoints](./search-headless.sandboxendpoints.md) | The endpoints to use for sandbox experiences. | ## Type Aliases | Type Alias | Description | | --- | --- | -| [AnswersConfig](./search-headless.answersconfig.md) | | | [Context](./search-headless.context.md) | Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | | [EnumOrLiteral](./search-headless.enumorliteral.md) | Produces a union type from the enum passed as a generic which consists of the enum values and the string literals of the enum. | | [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) | All possible built-in [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) interfaces. | diff --git a/docs/search-headless.provideanswersheadless.md b/docs/search-headless.provideanswersheadless.md deleted file mode 100644 index 7c1280ea..00000000 --- a/docs/search-headless.provideanswersheadless.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [provideAnswersHeadless](./search-headless.provideanswersheadless.md) - -## provideAnswersHeadless variable - -> Warning: This API is now obsolete. -> -> provideAnswersHeadless has been deprecated and renamed to provideHeadless -> - -Supplies a new instance of [SearchHeadless](./search-headless.searchheadless.md), using the provided configuration. - -Signature: - -```typescript -provideAnswersHeadless: typeof provideHeadless -``` diff --git a/docs/search-headless.universalsearchrequest.referrerpageurl.md b/docs/search-headless.universalsearchrequest.referrerpageurl.md index aa7edf37..db99b487 100644 --- a/docs/search-headless.universalsearchrequest.referrerpageurl.md +++ b/docs/search-headless.universalsearchrequest.referrerpageurl.md @@ -14,5 +14,5 @@ referrerPageUrl?: string; ## Example -If a user is on https://www.yext.com/ and navigates to https://www.yext.com/answers and perform a search, the referrerPageUrl would be https://www.yext.com/. +If a user is on https://www.yext.com/ and navigates to https://search.yext.com/ and perform a search, the referrerPageUrl would be https://www.yext.com/. diff --git a/etc/search-headless.api.md b/etc/search-headless.api.md index 0bf7ab3f..3f995a2d 100644 --- a/etc/search-headless.api.md +++ b/etc/search-headless.api.md @@ -52,36 +52,6 @@ export interface AndroidAppUrlDirectAnswer extends BaseFieldValueDirectAnswer; } -// @public @deprecated (undocumented) -export type AnswersConfig = SearchConfig; - -// @public @deprecated (undocumented) -export interface AnswersConfigWithApiKey extends SearchConfigWithApiKey { -} - -// @public @deprecated (undocumented) -export interface AnswersConfigWithToken extends SearchConfigWithToken { -} - -// @public @deprecated (undocumented) -export class AnswersCore extends SearchCore { -} - -// @public @deprecated (undocumented) -export interface AnswersError extends SearchError { -} - -// @public @deprecated (undocumented) -export class AnswersHeadless extends SearchHeadless { -} - -// @public @deprecated (undocumented) -export interface AnswersRequest extends SearchRequest { -} - -// @public @deprecated (undocumented) -export namespace answersUtilities { } - // @public export interface AppliedQueryFilter { details?: LocationFilterDetails; @@ -126,10 +96,6 @@ export interface AutocompleteService { verticalAutocomplete(request: VerticalAutocompleteRequest): Promise; } -// @public @deprecated (undocumented) -export interface BaseAnswersConfig extends BaseSearchConfig { -} - // @public export interface BaseFeaturedSnippetDirectAnswer extends DirectAnswer { fieldType: EnumOrLiteral; @@ -148,12 +114,14 @@ export interface BaseFieldValueDirectAnswer extends DirectAnswer // @public export interface BaseSearchConfig { + additionalQueryParams?: { + [key: string]: string | number | boolean; + }; endpoints?: Endpoints; experienceKey: string; experienceVersion?: 'STAGING' | 'PRODUCTION' | string | number; locale: string; visitor?: Visitor; - /* Excluded from this release type: additionalQueryParams */ } // @public @@ -553,9 +521,6 @@ export interface PhoneDirectAnswer extends BaseFieldValueDirectAnswer { fieldType: BuiltInFieldType.Phone; } -// @public @deprecated -export const provideAnswersHeadless: typeof provideHeadless; - // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "provideHeadless" because one of its declarations is marked as @internal // // @public diff --git a/package-lock.json b/package-lock.json index 87e4c37a..08c08054 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "BSD-3-Clause", "dependencies": { "@reduxjs/toolkit": "^1.8.1", - "@yext/search-core": "^2.0.0-alpha.215", + "@yext/search-core": "^2.0.0-alpha.218", "js-levenshtein": "^1.1.6", "lodash": "^4.17.21" }, @@ -4686,9 +4686,9 @@ } }, "node_modules/@yext/search-core": { - "version": "2.0.0-alpha.215", - "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.0.0-alpha.215.tgz", - "integrity": "sha512-KUB4SFzjmCYFnz2m0z3iPCMKstvbgpzW9gOFdYAscWdq0SNw0+Ch5gPUy3D+4eAPRA0vj7i4/YEL1CEeRtfShA==", + "version": "2.0.0-alpha.218", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.0.0-alpha.218.tgz", + "integrity": "sha512-G53E3tUjYzGrLzBeAnXwaovGl682QyKGzDveB+QfzZMpfOspdukxRFVmoEfePii86aNNbBLOF8vJZ/J/cwzCjg==", "dependencies": { "@babel/runtime-corejs3": "^7.12.5", "cross-fetch": "^3.1.5" @@ -16349,9 +16349,9 @@ } }, "@yext/search-core": { - "version": "2.0.0-alpha.215", - "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.0.0-alpha.215.tgz", - "integrity": "sha512-KUB4SFzjmCYFnz2m0z3iPCMKstvbgpzW9gOFdYAscWdq0SNw0+Ch5gPUy3D+4eAPRA0vj7i4/YEL1CEeRtfShA==", + "version": "2.0.0-alpha.218", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.0.0-alpha.218.tgz", + "integrity": "sha512-G53E3tUjYzGrLzBeAnXwaovGl682QyKGzDveB+QfzZMpfOspdukxRFVmoEfePii86aNNbBLOF8vJZ/J/cwzCjg==", "requires": { "@babel/runtime-corejs3": "^7.12.5", "cross-fetch": "^3.1.5" diff --git a/package.json b/package.json index 5f175c72..6fe3ce4d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "@reduxjs/toolkit": "^1.8.1", - "@yext/search-core": "^2.0.0-alpha.215", + "@yext/search-core": "^2.0.0-alpha.218", "js-levenshtein": "^1.1.6", "lodash": "^4.17.21" }, diff --git a/src/deprecated.ts b/src/deprecated.ts deleted file mode 100644 index a765e097..00000000 --- a/src/deprecated.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { searchUtilities, provideHeadless } from '.'; -import SearchHeadless from './search-headless'; - -export { - AnswersConfig, - AnswersConfigWithToken, - AnswersConfigWithApiKey, - AnswersCore, - AnswersError, - AnswersRequest, - BaseAnswersConfig -} from '@yext/search-core'; - -/** - * @public - * - * @deprecated answersUtilities has been deprecated and renamed to searchUtilities - */ -// eslint-disable-next-line @typescript-eslint/no-namespace -export namespace answersUtilities { searchUtilities; } - -/** - * Supplies a new instance of {@link SearchHeadless}, using the provided configuration. - * - * @param config - The apiKey, experienceKey, etc. needed to set up a front-end Answers - * experience. - * @returns The newly created instance of {@link SearchHeadless} - * - * @public - * - * @deprecated provideAnswersHeadless has been deprecated and renamed to provideHeadless - */ -export const provideAnswersHeadless = provideHeadless; - -/** - * @public - * - * @deprecated AnswersHeadless has been deprecated and renamed to SearchHeadless - */ -export class AnswersHeadless extends SearchHeadless {} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 8e8b5f54..1f3316a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,7 +13,6 @@ export * from './search-core-re-exports'; export * from './models'; export * from './constants'; export * from './utils/filter-creators'; -export * from './deprecated'; export { searchUtilities }; /** @@ -82,13 +81,13 @@ export function provideHeadless( throw new Error(`Cannot instantiate a SearchHeadless using the default headlessId "${headlessId}". ` + 'Specify a different headlessId.'); } - const answersCore = provideCore(searchConfig); + const searchCore = provideCore(searchConfig); const stateManager = new ReduxStateManager( store, headlessId || DEFAULT_HEADLESS_ID, headlessReducerManager); const httpManager = new HttpManager(); const httpHeaders = getHttpHeaders(additionalHttpHeaders); - const headless = new SearchHeadless(answersCore, stateManager, httpManager, httpHeaders); + const headless = new SearchHeadless(searchCore, stateManager, httpManager, httpHeaders); verticalKey ? headless.setVertical(verticalKey) : headless.setUniversal(); diff --git a/src/store.ts b/src/store.ts index cd3e9be8..65161220 100644 --- a/src/store.ts +++ b/src/store.ts @@ -24,7 +24,7 @@ export function createBaseStore(): HeadlessEnhancedStore { (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }), reducer: initialReducer, devTools: process.env.NODE_ENV === 'production' ? false : { - name: 'AnswersHeadless' + name: 'SearchHeadless' } }); return store; diff --git a/tests/integration/facets.ts b/tests/integration/facets.ts index a03347a7..0b0a9efb 100644 --- a/tests/integration/facets.ts +++ b/tests/integration/facets.ts @@ -112,7 +112,7 @@ it('facets are updated after a vertical search', async () => { ] }); } - const mockAnswersCore = { + const mockSearchCore = { verticalSearch: jest.fn().mockImplementation(mockSearchWithFacets) }; const initialState = { @@ -121,7 +121,7 @@ it('facets are updated after a vertical search', async () => { query: { input: 'test query' }, spellCheck: { enabled: true } }; - const answers = createMockedHeadless(mockAnswersCore, initialState); + const answers = createMockedHeadless(mockSearchCore, initialState); expect(answers.state.filters.facets).toEqual(undefined); answers.setVertical('vertical-key'); await answers.executeVerticalQuery(); diff --git a/tests/integration/query.ts b/tests/integration/query.ts index 7fc2140c..779fad57 100644 --- a/tests/integration/query.ts +++ b/tests/integration/query.ts @@ -94,7 +94,7 @@ describe('ensure correct results from latest request', () => { }); it('vertical search get correct results based on up-to-date response', async () => { - const answers = getAnswersHeadless(requestsTime); + const answers = getSearchHeadless(requestsTime); answers.setVertical('someKey'); answers.addListener({ valueAccessor: state => state.vertical?.results, @@ -121,7 +121,7 @@ describe('ensure correct results from latest request', () => { }); it('universal search get correct results based on up-to-date response', async () => { - const answers = getAnswersHeadless(requestsTime); + const answers = getSearchHeadless(requestsTime); answers.setUniversal(); answers.addListener({ valueAccessor: state => state.universal.verticals, @@ -148,7 +148,7 @@ describe('ensure correct results from latest request', () => { }); }); -function getAnswersHeadless(requestsTime: { [x: string]: number }) { +function getSearchHeadless(requestsTime: { [x: string]: number }) { const mockedCore: any = { verticalSearch: jest.fn( async (request: VerticalSearchRequest) => { const waitTime = requestsTime[request.query]; diff --git a/tests/integration/queryrules.ts b/tests/integration/queryrules.ts index 179e8eb1..dd134f54 100644 --- a/tests/integration/queryrules.ts +++ b/tests/integration/queryrules.ts @@ -28,7 +28,7 @@ function mockSearchWithQueryRules() { }); } -describe('AnswersHeadless queryRules interactions properly update state', () => { +describe('SearchHeadless queryRules interactions properly update state', () => { it('executeVerticalQuery properly updates queryRules state', async () => { const answers = createMockedHeadless({ verticalSearch: mockSearchWithQueryRules diff --git a/tests/integration/spellcheck.ts b/tests/integration/spellcheck.ts index 58021e98..4467d378 100644 --- a/tests/integration/spellcheck.ts +++ b/tests/integration/spellcheck.ts @@ -29,7 +29,7 @@ function mockSearchWithSpellcheck() { }); } -describe('AnswersHeadless spellcheck interactions properly update state', () => { +describe('SearchHeadless spellcheck interactions properly update state', () => { it('executeVerticalQuery properly updates spellcheck state', async () => { const answers = createMockedHeadless({ verticalSearch: mockSearchWithSpellcheck diff --git a/tests/mocks/createMockedHeadless.ts b/tests/mocks/createMockedHeadless.ts index 73a98173..e334e7f4 100644 --- a/tests/mocks/createMockedHeadless.ts +++ b/tests/mocks/createMockedHeadless.ts @@ -10,12 +10,12 @@ import { getHttpHeaders } from '../../src/utils/client-sdk-utils'; /** * Creates a Search Headless instance with a mocked Search Core. * - * @param mockedAnswersCore - Search Core overrides + * @param mockedSearchCore - Search Core overrides * @param initialState - The initial state of Search Headless * @returns The new Search Headless instance */ export function createMockedHeadless( - mockedAnswersCore: any = {}, + mockedSearchCore: any = {}, initialState: Partial = {}, store?: HeadlessEnhancedStore, headlessReducerManager?: HeadlessReducerManager, @@ -25,7 +25,7 @@ export function createMockedHeadless( store || createBaseStore(), DEFAULT_HEADLESS_ID, headlessReducerManager || new HeadlessReducerManager()); const headlessHttpManager = httpManager || new HttpManager(); const answers = new SearchHeadless( - mockedAnswersCore, reduxStateManager, headlessHttpManager, getHttpHeaders()); + mockedSearchCore, reduxStateManager, headlessHttpManager, getHttpHeaders()); answers.setState({ ...answers.state, ...initialState