Skip to content

Commit

Permalink
tests(file-picker): add test where the path starts with a dot
Browse files Browse the repository at this point in the history
  • Loading branch information
TungstnBallon committed Apr 12, 2024
1 parent 7590227 commit a2dc210
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libs/extensions/std/exec/src/file-picker-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,23 @@ describe('Validation of FilePickerExecutor', () => {
expect(result.left.message).toEqual(`File '/test.txt' not found`);
}
});

it('should work if the filename starts with a dot', async () => {
const text = readJvTestAsset('dot-valid-file-picker.jv');
uploadTestFile('test.txt');

const result = await parseAndExecuteArchiveInterpreter(text, fileSystem);

expect(R.isErr(result)).toEqual(false);
if (R.isOk(result)) {
expect(result.right).toEqual(
expect.objectContaining({
name: 'test.txt',
extension: 'txt',
ioType: IOType.FILE,
mimeType: R.MimeType.TEXT_PLAIN,
}),
);
}
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
//
// SPDX-License-Identifier: AGPL-3.0-only

pipeline TestPipeline {

block TestExtractor oftype TestFileExtractor {
}

block TestBlock oftype FilePicker {
path: './test.txt';
}

block TestLoader oftype TestFileLoader {
}

TestExtractor -> TestBlock -> TestLoader;
}

0 comments on commit a2dc210

Please sign in to comment.