Skip to content

Commit 158aafa

Browse files
E2E tests for consumer mode
1 parent 303a7ec commit 158aafa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/__tests__/consumer/node_redis.spec.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const NA = 'NA';
2323

2424
const redisPort = '6385';
2525

26-
const TOTAL_RAW_IMPRESSIONS = 16;
26+
const TOTAL_RAW_IMPRESSIONS = 17;
2727
const TOTAL_EVENTS = 2;
2828
const DEDUPED_IMPRESSIONS = 3;
2929

@@ -118,7 +118,8 @@ tape('Node.js Redis', function (t) {
118118

119119
/** Evaluation, track and manager methods on SDK_READY */
120120

121-
assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT'), 'on', 'Evaluations using Redis storage should be correct.');
121+
assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT', undefined, { properties: { /* empty properties are ignored */ } }), 'on', 'Evaluations using Redis storage should be correct.');
122+
assert.equal(await client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT', undefined, { properties: { some: 'value1' } }), 'on', 'Evaluations using Redis storage should be correct.');
122123
assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.');
123124

124125
assert.equal(await client.getTreatment('UT_Segment_member', 'UT_NOT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.');
@@ -223,7 +224,9 @@ tape('Node.js Redis', function (t) {
223224
// this should be deduped
224225
assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.');
225226
// this should be deduped
226-
assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.');
227+
assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT', undefined, { properties: { /* empty properties are ignored */ } }), 'off', 'Evaluations using Redis storage should be correct.');
228+
// this should not be deduped because of properties
229+
assert.equal(await client.getTreatment('other', 'UT_IN_SEGMENT', undefined, { properties: { some: 'value1' } }), 'off', 'Evaluations using Redis storage should be correct.');
227230

228231
assert.equal(await client.getTreatment('UT_Segment_member', 'UT_NOT_IN_SEGMENT'), 'off', 'Evaluations using Redis storage should be correct.');
229232
assert.equal(await client.getTreatment('other', 'UT_NOT_IN_SEGMENT'), 'on', 'Evaluations using Redis storage should be correct.');

0 commit comments

Comments
 (0)