Skip to content

Commit 99ff9b3

Browse files
Fix tests
1 parent 7478b75 commit 99ff9b3

2 files changed

Lines changed: 2 additions & 69 deletions

File tree

spec/src/modules/tracker.js

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -8726,12 +8726,6 @@ describe(`ConstructorIO - Tracker${bundledDescriptionSuffix}`, () => {
87268726
expect(tracker.trackQuizTriggerShow(rest)).to.be.an('error');
87278727
});
87288728

8729-
it('Should throw an error when no url is provided', () => {
8730-
const { tracker } = new ConstructorIO({ apiKey: testApiKey });
8731-
const { url: _, ...rest } = requiredParameters;
8732-
expect(tracker.trackQuizTriggerShow(rest)).to.be.an('error');
8733-
});
8734-
87358729
it('Should throw an error when invalid parameters are provided', () => {
87368730
const { tracker } = new ConstructorIO({ apiKey: testApiKey });
87378731

@@ -8881,34 +8875,6 @@ describe(`ConstructorIO - Tracker${bundledDescriptionSuffix}`, () => {
88818875

88828876
expect(tracker.trackQuizTriggerShow(requiredParameters)).to.equal(true);
88838877
});
8884-
8885-
it('Should truncate url param to 2048 characters max', (done) => {
8886-
const longUrl = createLongUrl(3000);
8887-
const truncatedUrl = longUrl.slice(0, 2048);
8888-
8889-
const { tracker } = new ConstructorIO({
8890-
apiKey: testApiKey,
8891-
fetch: fetchSpy,
8892-
...requestQueueOptions,
8893-
});
8894-
8895-
tracker.on('success', () => {
8896-
const requestParams = helpers.extractBodyParamsFromFetch(fetchSpy);
8897-
8898-
// Request
8899-
expect(fetchSpy).to.have.been.called;
8900-
expect(requestParams.url).to.equal(truncatedUrl);
8901-
8902-
done();
8903-
});
8904-
8905-
const parameters = {
8906-
...requiredParameters,
8907-
url: longUrl,
8908-
};
8909-
8910-
expect(tracker.trackQuizTriggerShow(parameters)).to.equal(true);
8911-
});
89128878
});
89138879

89148880
describe('trackQuizTriggerClick', () => {
@@ -9147,12 +9113,6 @@ describe(`ConstructorIO - Tracker${bundledDescriptionSuffix}`, () => {
91479113
expect(tracker.trackQuizTriggerClick(rest)).to.be.an('error');
91489114
});
91499115

9150-
it('Should throw an error when no url is provided', () => {
9151-
const { tracker } = new ConstructorIO({ apiKey: testApiKey });
9152-
const { url: _, ...rest } = requiredParameters;
9153-
expect(tracker.trackQuizTriggerClick(rest)).to.be.an('error');
9154-
});
9155-
91569116
it('Should throw an error when invalid parameters are provided', () => {
91579117
const { tracker } = new ConstructorIO({ apiKey: testApiKey });
91589118

@@ -9302,34 +9262,6 @@ describe(`ConstructorIO - Tracker${bundledDescriptionSuffix}`, () => {
93029262

93039263
expect(tracker.trackQuizTriggerClick(requiredParameters)).to.equal(true);
93049264
});
9305-
9306-
it('Should truncate url param to 2048 characters max', (done) => {
9307-
const longUrl = createLongUrl(3000);
9308-
const truncatedUrl = longUrl.slice(0, 2048);
9309-
9310-
const { tracker } = new ConstructorIO({
9311-
apiKey: testApiKey,
9312-
fetch: fetchSpy,
9313-
...requestQueueOptions,
9314-
});
9315-
9316-
tracker.on('success', () => {
9317-
const requestParams = helpers.extractBodyParamsFromFetch(fetchSpy);
9318-
9319-
// Request
9320-
expect(fetchSpy).to.have.been.called;
9321-
expect(requestParams.url).to.equal(truncatedUrl);
9322-
9323-
done();
9324-
});
9325-
9326-
const parameters = {
9327-
...requiredParameters,
9328-
url: longUrl,
9329-
};
9330-
9331-
expect(tracker.trackQuizTriggerClick(parameters)).to.equal(true);
9332-
});
93339265
});
93349266

93359267
describe('on', () => {

src/modules/tracker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,8 @@ class Tracker {
25812581

25822582
bodyParams.quiz_id = quizId;
25832583
bodyParams.matched_facet = matchedFacet;
2584-
bodyParams.matchedQuery = matchedQuery;
2584+
bodyParams.matched_query = matchedQuery;
2585+
bodyParams.search_query = searchQuery;
25852586

25862587
if (!helpers.isNil(section)) {
25872588
if (typeof section !== 'string') {

0 commit comments

Comments
 (0)