@@ -129,47 +129,15 @@ describe('data.raw', function() {
129129 } ) ;
130130 } ) ;
131131
132- describe ( 'nullFilter' , function ( ) {
133- var spec = {
134- marktype : 'point' ,
135- encoding : {
136- y : { name : 'Q' , type :'Q' } ,
137- x : { name : 'T' , type :'T' } ,
138- color : { name : 'O' , type :'O' }
139- }
140- } ;
141-
142- it ( 'should add filterNull for Q and T by default' , function ( ) {
143- var encoding = Encoding . fromSpec ( spec ) ;
144- expect ( data . raw . transform . nullFilter ( encoding ) )
145- . to . eql ( [ {
146- type : 'filter' ,
147- test : 'T!==null && Q!==null'
148- } ] ) ;
149- } ) ;
132+ describe ( 'filter' , function ( ) {
133+ it ( 'should return filter transform that include filter null' , function ( ) {
134+ var transform = data . raw . transform . filter ( encoding ) ;
150135
151- it ( 'should add filterNull for O when specified' , function ( ) {
152- var encoding = Encoding . fromSpec ( spec , {
153- config : {
154- filterNull : { O : true }
155- }
136+ expect ( transform [ 0 ] ) . to . eql ( {
137+ type : 'filter' ,
138+ test : '(d.data.a!==null) && (d.data.Acceleration!==null)' +
139+ ' && (d.data.a > b) && (d.data.c == d)'
156140 } ) ;
157- expect ( data . raw . transform . nullFilter ( encoding ) )
158- . to . eql ( [ {
159- type : 'filter' ,
160- test :'T!==null && Q!==null && O!==null'
161- } ] ) ;
162- } ) ;
163- // });
164- } ) ;
165-
166- describe ( 'filter' , function ( ) {
167- it ( 'should return array that contains a filter transform' , function ( ) {
168- expect ( data . raw . transform . filter ( encoding ) )
169- . to . eql ( [ {
170- type : 'filter' ,
171- test : '(d.data.a > b) && (d.data.c == d)'
172- } ] ) ;
173141 } ) ;
174142
175143 it ( 'should exclude unsupported operator' , function ( ) {
@@ -197,12 +165,11 @@ describe('data.raw', function() {
197165 } ) ;
198166 } ) ;
199167
200- it ( 'should have null filter, timeUnit, bin then filter' , function ( ) {
168+ it ( 'should time and bin before filter' , function ( ) {
201169 var transform = data . raw . transform ( encoding ) ;
202- expect ( transform [ 0 ] . type ) . to . eql ( 'filter' ) ;
203- expect ( transform [ 1 ] . type ) . to . eql ( 'formula' ) ;
204- expect ( transform [ 2 ] . type ) . to . eql ( 'bin' ) ;
205- expect ( transform [ 3 ] . type ) . to . eql ( 'filter' ) ;
170+ expect ( transform [ 0 ] . type ) . to . eql ( 'formula' ) ;
171+ expect ( transform [ 1 ] . type ) . to . eql ( 'bin' ) ;
172+ expect ( transform [ 2 ] . type ) . to . eql ( 'filter' ) ;
206173 } ) ;
207174
208175 } ) ;
0 commit comments