Skip to content
Snippets Groups Projects

Remove base64 encoding from files that contain plain text

Merged Jacques Erasmus requested to merge fix-base64-encoded-file-uploads into master
All threads resolved!
@@ -57,14 +57,13 @@ describe('new dropdown upload', () => {
describe('createFile', () => {
const textTarget = {
result: 'base64,cGxhaW4gdGV4dA==',
type: 'text/plain',
};
const binaryTarget = {
result: 'base64,w4I=',
type: 'image/png',
};
const file = {
name: 'file',
type: 'text/plain',
};
it('creates file in plain text (without encoding) if the file content is plain text', () => {
@@ -78,6 +77,8 @@ describe('new dropdown upload', () => {
});
});
file.type = 'image/png';
it('splits content on base64 if binary', () => {
vm.createFile(binaryTarget, file);
Loading