Fixes tests

This commit is contained in:
Zeno Rocha 2015-09-26 07:32:27 -07:00
parent e3f69de585
commit bb60a866b2
2 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,10 @@ class Clipboard extends Emitter {
constructor(selector) {
super();
if (!document.querySelectorAll(selector).length) {
throw new Error('No matches were found for the provided selector');
}
delegate.bind(document.body, selector, 'click', (e) => this.initialize(e));
}

View File

@ -14,7 +14,7 @@ describe('ClipboardAction', () => {
describe('#constructor', () => {
it('should throw an error since "data-action" is invalid', (done) => {
try {
new Clipboard({
new ClipboardAction({
action: 'paste'
});
}