@@ -143,6 +143,66 @@ describe('fromFlux', () => {
143143 expect ( fluxGroupKeyUnion ) . toEqual ( [ 'a' , 'c' , 'd' ] )
144144 } )
145145
146+ test ( 'returns all result column names' , ( ) => {
147+ const CSV = `#group,true,false,false,true
148+ #datatype,string,string,string,string
149+ #default,new,,,
150+ ,result,b,c,d
151+ ,,0,0,0
152+
153+ #group,false,false,true,false
154+ #datatype,string,string,string,string
155+ #default,old,,,
156+ ,result,b,c,d
157+ ,,0,0,0`
158+
159+ const flux = fromFlux ( CSV )
160+ const fluxLegacy = fromFluxLegacy ( CSV )
161+
162+ expect ( flux . resultColumnNames ) . toEqual ( [ 'new' , 'old' ] )
163+ expect ( fluxLegacy . resultColumnNames ) . toEqual ( [ 'new' , 'old' ] )
164+ } )
165+
166+ test ( 'handles blank result column names' , ( ) => {
167+ const CSV = `#group,true,false,false,true
168+ #datatype,string,string,string,string
169+ #default,,,,
170+ ,result,b,c,d
171+ ,,0,0,0
172+
173+ #group,false,false,true,false
174+ #datatype,string,string,string,string
175+ #default,,,,
176+ ,result,b,c,d
177+ ,,0,0,0`
178+
179+ const flux = fromFlux ( CSV )
180+ const fluxLegacy = fromFluxLegacy ( CSV )
181+
182+ expect ( flux . resultColumnNames ) . toEqual ( [ ] )
183+ expect ( fluxLegacy . resultColumnNames ) . toEqual ( [ ] )
184+ } )
185+
186+ test ( 'handles missing result column' , ( ) => {
187+ const CSV = `#group,true,false,false,true
188+ #datatype,string,string,string,string
189+ #default,_result,,,
190+ ,a,b,c,d
191+ ,,0,0,0
192+
193+ #group,false,false,true,false
194+ #datatype,string,string,string,string
195+ #default,_result,,,
196+ ,a,b,c,d
197+ ,,0,0,0`
198+
199+ const flux = fromFlux ( CSV )
200+ const fluxLegacy = fromFluxLegacy ( CSV )
201+
202+ expect ( flux . resultColumnNames ) . toEqual ( [ ] )
203+ expect ( fluxLegacy . resultColumnNames ) . toEqual ( [ ] )
204+ } )
205+
146206 test ( 'parses empty numeric values as null' , ( ) => {
147207 const CSV = `#group,false,false,true,true,false,true,true,true,true,true
148208#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
0 commit comments