Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Created May 11, 2018 19:47
Show Gist options
  • Save ChrisMoney/c4a1259040b34f3613a28e16d502076e to your computer and use it in GitHub Desktop.
Save ChrisMoney/c4a1259040b34f3613a28e16d502076e to your computer and use it in GitHub Desktop.
Angular Unit Test
import { FileDropUploadComponent } from './file-drop-upload.component';
describe('FileDropUploadComponent', () => {
let component: FileDropUploadComponent;
beforeEach(() => {
component = new FileDropUploadComponent();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should emit messages when uploading files from drop', (done) => {
const documentKey = 'documentKeyTest';
component.documentUploaded.subscribe(g => {
expect(g).toEqual(documentKey);
done();
});
component.uploadFilesFromDrop(documentKey);
});
it('should emit messages when uploading files from dialog', (done) => {
const documentKey = 'documentKeyTest';
component.documentUploaded.subscribe(g => {
expect(g).toEqual(documentKey);
done();
});
component.uploadFilesFromDialog(documentKey);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment