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() {
95
95
expect ( valid ) . toBeTruthy ( ) ;
96
96
} ) ;
97
97
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
+
98
115
it ( 'should validate multiple filter-file hooks' , async function ( ) {
99
116
const customFunction = jasmine . createSpy ( 'fn' ) ;
100
117
flow . on ( 'filter-file' , async ( ) => {
You can’t perform that action at this time.
0 commit comments