@@ -83,7 +83,7 @@ describe('default preset', () => {
83
83
84
84
expect ( client . transporter . requestsCache ) . not . toBe ( cache ) ;
85
85
expect ( customClient . transporter . requestsCache ) . toBe ( cache ) ;
86
- expect ( customClient . initRecommendation ( ) . transporter . requestsCache ) . not . toBe ( cache ) ;
86
+ expect ( customClient . initPersonalization ( ) . transporter . requestsCache ) . not . toBe ( cache ) ;
87
87
expect ( customClient . initAnalytics ( { requestsCache : cache } ) . transporter . requestsCache ) . toBe (
88
88
cache
89
89
) ;
@@ -92,7 +92,7 @@ describe('default preset', () => {
92
92
read : 46 ,
93
93
write : 47 ,
94
94
} ) ;
95
- expect ( customClient . initRecommendation ( ) . transporter . timeouts ) . toEqual ( {
95
+ expect ( customClient . initPersonalization ( ) . transporter . timeouts ) . toEqual ( {
96
96
connect : testing . isBrowser ( ) ? 1 : 2 ,
97
97
read : testing . isBrowser ( ) ? 2 : 5 ,
98
98
write : 30 ,
@@ -110,7 +110,7 @@ describe('default preset', () => {
110
110
expect ( customClient . transporter . hosts ) . toEqual ( [ createStatelessHost ( { url : 'foo.com' } ) ] ) ;
111
111
112
112
expect ( customClient . initAnalytics ( ) . transporter . queryParameters ) . toEqual ( { } ) ;
113
- expect ( customClient . initRecommendation ( ) . transporter . headers ) . toEqual ( {
113
+ expect ( customClient . initPersonalization ( ) . transporter . headers ) . toEqual ( {
114
114
'content-type' : 'application/json' ,
115
115
'x-algolia-application-id' : 'appId' ,
116
116
'x-algolia-api-key' : 'apiKey' ,
@@ -119,31 +119,31 @@ describe('default preset', () => {
119
119
createStatelessHost ( { url : 'foo.com' } ) ,
120
120
] ) ;
121
121
122
- expect ( customClient . initRecommendation ( ) . transporter . queryParameters ) . not . toEqual ( {
122
+ expect ( customClient . initPersonalization ( ) . transporter . queryParameters ) . not . toEqual ( {
123
123
queryParameter : 'bar' ,
124
124
} ) ;
125
125
126
- expect ( customClient . initRecommendation ( ) . transporter . headers ) . toEqual ( {
126
+ expect ( customClient . initPersonalization ( ) . transporter . headers ) . toEqual ( {
127
127
'content-type' : 'application/json' ,
128
128
'x-algolia-application-id' : 'appId' ,
129
129
'x-algolia-api-key' : 'apiKey' ,
130
130
} ) ;
131
- expect ( customClient . initRecommendation ( ) . transporter . hosts ) . not . toEqual ( [
131
+ expect ( customClient . initPersonalization ( ) . transporter . hosts ) . not . toEqual ( [
132
132
createStatelessHost ( { url : 'foo.com' } ) ,
133
133
] ) ;
134
134
} ) ;
135
135
136
136
test ( 'shared implementations between clients' , ( ) => {
137
137
const analytics = client . initAnalytics ( ) ;
138
- const recommendation = client . initRecommendation ( ) ;
138
+ const personalization = client . initPersonalization ( ) ;
139
139
140
140
expect ( analytics . transporter ) . not . toBe ( client . transporter ) ;
141
141
expect ( analytics . transporter . hostsCache ) . toBe ( client . transporter . hostsCache ) ;
142
142
expect ( analytics . transporter . userAgent ) . toBe ( client . transporter . userAgent ) ;
143
143
144
- expect ( recommendation . transporter ) . not . toBe ( client . transporter ) ;
145
- expect ( recommendation . transporter . hostsCache ) . toBe ( client . transporter . hostsCache ) ;
146
- expect ( recommendation . transporter . userAgent ) . toBe ( client . transporter . userAgent ) ;
144
+ expect ( personalization . transporter ) . not . toBe ( client . transporter ) ;
145
+ expect ( personalization . transporter . hostsCache ) . toBe ( client . transporter . hostsCache ) ;
146
+ expect ( personalization . transporter . userAgent ) . toBe ( client . transporter . userAgent ) ;
147
147
} ) ;
148
148
149
149
test ( 'allows clients to override credentials' , ( ) => {
@@ -154,12 +154,12 @@ describe('default preset', () => {
154
154
const analytics = clientWithOptions . initAnalytics ( {
155
155
apiKey : 'analytics' ,
156
156
} ) ;
157
- const recommendation = clientWithOptions . initRecommendation ( {
158
- apiKey : 'recommendation ' ,
157
+ const personalization = clientWithOptions . initPersonalization ( {
158
+ apiKey : 'personalization ' ,
159
159
} ) ;
160
160
161
161
expect ( analytics . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'analytics' ) ;
162
- expect ( recommendation . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'recommendation ' ) ;
162
+ expect ( personalization . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'personalization ' ) ;
163
163
} ) ;
164
164
165
165
test ( 'allows clients to keep default credentials' , ( ) => {
@@ -168,10 +168,10 @@ describe('default preset', () => {
168
168
expect ( clientWithOptions . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'apiKey' ) ;
169
169
170
170
const analytics = clientWithOptions . initAnalytics ( ) ;
171
- const recommendation = clientWithOptions . initRecommendation ( ) ;
171
+ const personalization = clientWithOptions . initPersonalization ( ) ;
172
172
173
173
expect ( analytics . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'apiKey' ) ;
174
- expect ( recommendation . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'apiKey' ) ;
174
+ expect ( personalization . transporter . headers [ 'x-algolia-api-key' ] ) . toBe ( 'apiKey' ) ;
175
175
} ) ;
176
176
177
177
it ( 'can be destroyed' , ( ) => {
0 commit comments