some frontend unit tests
This commit is contained in:
parent
4929437283
commit
78728ce4ca
24 changed files with 708 additions and 417 deletions
17
test/frontend/tests/fileSender-tests.js
Normal file
17
test/frontend/tests/fileSender-tests.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue