Default options for ClipboardAction too

This commit is contained in:
Jory Graham
2015-09-29 20:23:05 -04:00
parent 902c730a4d
commit d66aab1124
2 changed files with 2 additions and 4 deletions

View File

@ -6,7 +6,7 @@ class ClipboardAction {
* Initializes selection from either `text` or `target` property. * Initializes selection from either `text` or `target` property.
* @param {Object} options * @param {Object} options
*/ */
constructor(options) { constructor(options = {}) {
this.action = options.action; this.action = options.action;
this.emitter = options.emitter; this.emitter = options.emitter;
this.target = options.target; this.target = options.target;

View File

@ -35,9 +35,7 @@ describe('ClipboardAction', () => {
it('should throw an error since neither "text" nor "target" were passed', done => { it('should throw an error since neither "text" nor "target" were passed', done => {
try { try {
new ClipboardAction({ new ClipboardAction();
action: undefined
});
} }
catch(e) { catch(e) {
assert.equal(e.message, 'Missing required attributes, use either "target" or "text"'); assert.equal(e.message, 'Missing required attributes, use either "target" or "text"');