File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,23 @@ describe('fileAdd event', function() {
9595 expect ( valid ) . toBeTruthy ( ) ;
9696 } ) ;
9797
98+ it ( 'should validate file-added filtering before files-added' , async function ( ) {
99+ var valid = false ;
100+ flow . on ( 'file-added' , ( flowfile ) => {
101+ if ( flowfile . name === 'f2' ) {
102+ delete flowfile . file ;
103+ }
104+ } ) ;
105+ flow . on ( 'files-added' , ( files ) => {
106+ valid = files . length === 1 ;
107+ } ) ;
108+ await flow . addFiles ( [
109+ new File ( [ 'file' ] , 'f1' ) ,
110+ new File ( [ 'file2' ] , 'f2' )
111+ ] ) ;
112+ expect ( valid ) . toBeTruthy ( ) ;
113+ } ) ;
114+
98115 it ( 'should validate multiple filter-file hooks' , async function ( ) {
99116 const customFunction = jasmine . createSpy ( 'fn' ) ;
100117 flow . on ( 'filter-file' , async ( ) => {
You can’t perform that action at this time.
0 commit comments