Removes code from #constructor to separate functions

This commit is contained in:
Zeno Rocha
2015-09-29 22:14:26 -07:00
parent 3394f59691
commit a5e29bd420
4 changed files with 104 additions and 41 deletions

View File

@ -19,7 +19,23 @@ describe('ClipboardAction', () => {
document.body.innerHTML = '';
});
describe('#constructor', () => {
describe('#resolveOptions', () => {
it('should set base properties', () => {
let clip = new ClipboardAction({
emitter: new Emitter(),
text: 'foo'
});
assert.property(clip, 'action');
assert.property(clip, 'emitter');
assert.property(clip, 'target');
assert.property(clip, 'text');
assert.property(clip, 'trigger');
assert.property(clip, 'selectedText');
});
});
describe('#initSelection', () => {
it('should throw an error since both "text" and "target" were passed', done => {
try {
new ClipboardAction({