We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29b0ea6 commit a44217cCopy full SHA for a44217c
test/fileAddSpec.js
@@ -95,6 +95,23 @@ describe('fileAdd event', function() {
95
expect(valid).toBeTruthy();
96
});
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
+
115
it('should validate multiple filter-file hooks', async function() {
116
const customFunction = jasmine.createSpy('fn');
117
flow.on('filter-file', async () => {
0 commit comments