Skip to content

Commit 6bfb4bc

Browse files
fix copyright date to reflect only 2020, remove unnecessary comments, and switched to 2 space tab style
1 parent 931dea2 commit 6bfb4bc

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

packages/optimizely-sdk/lib/core/notification_center/index.tests.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* Copyright 2017-2020, Optimizely, Inc. and contributors *
2+
* Copyright 2020, Optimizely, Inc. and contributors *
33
* *
44
* Licensed under the Apache License, Version 2.0 (the "License"); *
55
* you may not use this file except in compliance with the License. *
@@ -14,7 +14,6 @@
1414
* limitations under the License. *
1515
***************************************************************************/
1616

17-
// MODULES FOR OBJECTS TO BE USED BY TESTS
1817
var NotificationCenter = require('./')
1918
var errorHandler = require('../../plugins/error_handler');
2019
var logger = require('../../plugins/logger');
@@ -128,8 +127,6 @@ describe('lib/core/notification_center', function() {
128127
), -1);
129128

130129
});
131-
132-
// should return an id of notification listener (listenerId) if ACTIVATE listener is not already added
133130
it('should return an id (listenerId) > 0 of the notification listener if ACTIVATE callback is not already added', function(){
134131
listenerId = notificationCenterInstance.addNotificationListener(
135132
enums.NOTIFICATION_TYPES.ACTIVATE,
@@ -152,8 +149,6 @@ describe('lib/core/notification_center', function() {
152149
decisionCallbackSpy1
153150
), -1);
154151
});
155-
156-
// should return an id of notification listener (listenerId) if DECISION listener is not already added
157152
it('should return an id (listenerId) > 0 of the notification listener if DECISION callback is not already added', function(){
158153
listenerId = notificationCenterInstance.addNotificationListener(
159154
enums.NOTIFICATION_TYPES.DECISION,
@@ -176,8 +171,6 @@ describe('lib/core/notification_center', function() {
176171
logEventCallbackSpy1
177172
), -1);
178173
});
179-
180-
// should return an id of notification listener (listenerId) if LOG_EVENT listener is not already added
181174
it('should return an id (listenerId) > 0 of the notification listener if LOG_EVENT callback is not already added', function(){
182175
listenerId = notificationCenterInstance.addNotificationListener(
183176
enums.NOTIFICATION_TYPES.LOG_EVENT,
@@ -186,8 +179,6 @@ describe('lib/core/notification_center', function() {
186179

187180
assert.isAbove(listenerId, 0);
188181
});
189-
190-
// LOG_EVENT: should return callback with object argument properties of: url {str}, httpVerb {str}, params {obj} when an impression or conversion is sent
191182
});
192183

193184
context('add notification listener for type OPTIMIZELY_CONFIG_UPDATE', function(){
@@ -202,8 +193,6 @@ describe('lib/core/notification_center', function() {
202193
configUpdateCallbackSpy1
203194
), -1);
204195
});
205-
206-
// should return an id of notification listener (listenerId) if OPTIMIZELY_CONFIG_UPDATE listener is not already added
207196
it('should return an id (listenerId) > 0 of the notification listener if OPTIMIZELY_CONFIG_UPDATE callback is not already added', function(){
208197
listenerId = notificationCenterInstance.addNotificationListener(
209198
enums.NOTIFICATION_TYPES.OPTIMIZELY_CONFIG_UPDATE,
@@ -226,8 +215,6 @@ describe('lib/core/notification_center', function() {
226215
trackCallbackSpy1
227216
), -1);
228217
});
229-
230-
// should return an id of notification listener (listenerId) if TRACK listener is not already added
231218
it('should return an id (listenerId) > 0 of the notification listener if TRACK callback is not already added', function(){
232219
listenerId = notificationCenterInstance.addNotificationListener(
233220
enums.NOTIFICATION_TYPES.TRACK,
@@ -236,8 +223,6 @@ describe('lib/core/notification_center', function() {
236223

237224
assert.isAbove(listenerId, 0);
238225
});
239-
240-
// TRACK: should return a callback with object argument properties of: eventKey {str}, userId {str}, attributes {obj|undef}, eventTags {obj|undef}, logEvent {obj} when a conversion event is sent to Optimizely
241226
});
242227
});
243228

@@ -873,8 +858,7 @@ describe('lib/core/notification_center', function() {
873858
});
874859

875860
describe('#sendNotifications', function() {
876-
context('send notification for type ACTIVATE', function(){
877-
// ACTIVATE: should return callback with object argument properties of: experiment {obj}, user_id {str}, attributes{obj|undef}, variation{obj}, logEvent {obj} when an impression is sent
861+
context('send notification for type ACTIVATE', function(){
878862
it('the ACTIVATE callback should be called with exact options arguments', function(){
879863
var activateData = {
880864
experiment: {},
@@ -893,7 +877,6 @@ describe('lib/core/notification_center', function() {
893877
});
894878

895879
context('send notification for type DECISION', function(){
896-
// DECISION: should return callback with object argument properties of: type {str}, userId {str}, attributes {obj|undef}, decisionInfo {obj|undef} when a decision is made in the system; type {str} (DECISION_TYPES): feature, ab-test, feature-test, feature-variable decisionInfo {obj|undef}: decisionInfo k-v map determined by type {str}
897880
it('the DECISION callback should be ccalled with exact arguments', function(){
898881
var decisionData = {
899882
type: '',
@@ -911,7 +894,6 @@ describe('lib/core/notification_center', function() {
911894
});
912895

913896
context('send notification for type LOG_EVENT', function(){
914-
// LOG_EVENT: should return callback with object argument properties of: url {str}, httpVerb {str}, params {obj} when an impression or conversion is sent
915897
it('the LOG_EVENT callback should be called with exact arguments', function(){
916898
var logEventData = {
917899
url: '',
@@ -928,7 +910,6 @@ describe('lib/core/notification_center', function() {
928910
});
929911

930912
context('send notification for type OPTIMIZELY_CONFIG_UPDATE', function(){
931-
// OPTIMIZELY_CONFIG_UPDATE: should return 'OPTIMIZELY_CONFIG_UPDATE'
932913
it('the OPTIMIZELY_CONFIG_UPDATE callback should be called with exact arguments', function(){
933914
var configUpdateData = {};
934915
notificationCenterInstance.addNotificationListener(
@@ -941,7 +922,6 @@ describe('lib/core/notification_center', function() {
941922
});
942923

943924
context('send notification for type TRACK', function(){
944-
// TRACK: should return a callback with object argument properties of: eventKey {str}, userId {str}, attributes {obj|undef}, eventTags {obj|undef}, logEvent {obj} when a conversion event is sent to Optimizely
945925
it('the TRACK callback should be called with exact arguments', function(){
946926
var trackData = {
947927
eventKey: '',

0 commit comments

Comments
 (0)