1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-14 23:22:36 +01:00
send/test/frontend/tests/fileSender-tests.js

18 lines
532 B
JavaScript
Raw Normal View History

2018-02-21 05:31:27 +01:00
import assert from 'assert';
import FileSender from '../../../app/fileSender';
// FileSender uses a File in real life but a Blob works for testing
const blob = new Blob(['hello world!'], { type: 'text/plain' });
blob.name = 'text.txt';
describe('FileSender', function() {
describe('upload', function() {
it('returns an OwnedFile on success', async function() {
const fs = new FileSender(blob);
const file = await fs.upload();
assert.ok(file.id);
assert.equal(file.name, blob.name);
});
});
});