@@ -1889,31 +1889,29 @@ describe('lib/optimizely', function() {
1889
1889
} ) ;
1890
1890
} ) ;
1891
1891
1892
- describe ( '__filterAttributes ' , function ( ) {
1893
- it ( 'should filter out a null value attribute ' , function ( ) {
1894
- var attributes = { 'test' : null } ;
1895
- var filteredAttributes = optlyInstance . __filterAttributes ( attributes ) ;
1896
- assert . deepEqual ( filteredAttributes , { } ) ;
1892
+ describe ( 'should filter out null values ' , function ( ) {
1893
+ it ( 'should filter out a null value' , function ( ) {
1894
+ var dict = { 'test' : null } ;
1895
+ var filteredValue = optlyInstance . __filterEmptyValues ( dict ) ;
1896
+ assert . deepEqual ( filteredValue , { } ) ;
1897
1897
} ) ;
1898
1898
1899
- it ( 'should filter out a null value attribute, leave a non null one ' , function ( ) {
1900
- var attributes = { 'test' : null , 'test2' : 'not_null' } ;
1901
- var filteredAttributes = optlyInstance . __filterAttributes ( attributes ) ;
1902
- assert . deepEqual ( filteredAttributes , { 'test2' : 'not_null' } ) ;
1899
+ it ( 'should filter out a undefined value' , function ( ) {
1900
+ var dict = { 'test' : undefined } ;
1901
+ var filteredValue = optlyInstance . __filterEmptyValues ( dict ) ;
1902
+ assert . deepEqual ( filteredValue , { } ) ;
1903
1903
} ) ;
1904
- } ) ;
1905
1904
1906
- describe ( '__filterEventTags' , function ( ) {
1907
- it ( 'should filter out a null value eventTag' , function ( ) {
1908
- var eventTags = { 'test' : null } ;
1909
- var filteredEventTags = optlyInstance . __filterEventTags ( eventTags ) ;
1910
- assert . deepEqual ( filteredEventTags , { } ) ;
1905
+ it ( 'should filter out a null value, leave a non null one' , function ( ) {
1906
+ var dict = { 'test' : null , 'test2' : 'not_null' } ;
1907
+ var filteredValue = optlyInstance . __filterEmptyValues ( dict ) ;
1908
+ assert . deepEqual ( filteredValue , { 'test2' : 'not_null' } ) ;
1911
1909
} ) ;
1912
1910
1913
- it ( 'should filter out a null value attribute, leave a non null one ' , function ( ) {
1914
- var eventTags = { 'test' : null , 'test2' : 'not_null '} ;
1915
- var filteredEventTags = optlyInstance . __filterEventTags ( eventTags ) ;
1916
- assert . deepEqual ( filteredEventTags , { 'test2 ' : 'not_null ' } ) ;
1911
+ it ( 'should not filter out a non empty value ' , function ( ) {
1912
+ var dict = { 'test' : 'hello '} ;
1913
+ var filteredValue = optlyInstance . __filterEmptyValues ( dict ) ;
1914
+ assert . deepEqual ( filteredValue , { 'test ' : 'hello ' } ) ;
1917
1915
} ) ;
1918
1916
} ) ;
1919
1917
0 commit comments