Skip to content

Commit 1cdfbed

Browse files
author
dmitrycnstrc
committed
update agent test
1 parent dd6761e commit 1cdfbed

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

spec/src/modules/agent.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -172,42 +172,18 @@ describe(`ConstructorIO - Agent${bundledDescriptionSuffix}`, () => {
172172
expect(requestedUrlParams).to.have.property('pre_filter_expression').to.equal(JSON.stringify(preFilterExpression));
173173
});
174174

175-
it('should include preFilterExpression as string when provided as string', () => {
176-
const preFilterExpression = '{"and":[{"name":"brand","value":"Nike"}]}';
177-
const url = createAgentUrl(
178-
'running shoes',
179-
{ ...defaultParameters, preFilterExpression },
180-
defaultOptions,
181-
);
182-
const requestedUrlParams = qs.parse(url.split('?')?.[1]);
183-
184-
expect(requestedUrlParams).to.have.property('pre_filter_expression').to.equal(preFilterExpression);
185-
});
186-
187-
it('should include qs as JSON string when provided as object', () => {
175+
it('should include qsParam as JSON string when provided as object', () => {
188176
const qsParam = { section: 'Products' };
189177
const url = createAgentUrl(
190178
'running shoes',
191-
{ ...defaultParameters, qs: qsParam },
179+
{ ...defaultParameters, qsParam },
192180
defaultOptions,
193181
);
194182
const requestedUrlParams = qs.parse(url.split('?')?.[1]);
195183

196184
expect(requestedUrlParams).to.have.property('qs').to.equal(JSON.stringify(qsParam));
197185
});
198186

199-
it('should include qs as string when provided as string', () => {
200-
const qsParam = 'section=Products';
201-
const url = createAgentUrl(
202-
'running shoes',
203-
{ ...defaultParameters, qs: qsParam },
204-
defaultOptions,
205-
);
206-
const requestedUrlParams = qs.parse(url.split('?')?.[1]);
207-
208-
expect(requestedUrlParams).to.have.property('qs').to.equal(qsParam);
209-
});
210-
211187
it('should include fmtOptions when provided', () => {
212188
const fmtOptions = { fields: ['title', 'image_url'], hidden_fields: ['price'] };
213189
const url = createAgentUrl(

0 commit comments

Comments
 (0)