fix(issue-77): hides both sidebars when initializing with 'sidebar: false' (#81)

This commit is contained in:
Jamie Peabody
2018-05-26 12:48:15 -07:00
committed by GitHub
parent 157d763af6
commit d7a7ddcd55
2 changed files with 26 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ describe('mergely', function () {
});
});
it.only('initializes with static arguments for lhs/rhs text', function (done) {
it('initializes with static arguments for lhs/rhs text', function (done) {
$(document).ready(() => {
const editor = init({
height: 100,
@@ -70,5 +70,27 @@ describe('mergely', function () {
});
});
it('initializes with no sidebar', function (done) {
$(document).ready(() => {
const editor = init({
height: 100,
license: 'lgpl-separate-notice',
sidebar: false
});
expect(editor).to.exist;
expect(editor.mergely).to.exist;
const children = editor.children();
expect(children.length).to.equal(6);
expect($(children[0]).attr('id')).to.equal('mergely-splash');
expect($(children[1]).attr('class')).to.equal('mergely-margin');
expect($(children[1]).css('display')).to.equal('none');
expect($(children[2]).attr('class')).to.equal('mergely-column');
expect($(children[3]).attr('class')).to.equal('mergely-canvas');
expect($(children[4]).attr('class')).to.equal('mergely-column');
expect($(children[5]).attr('class')).to.equal('mergely-margin');
expect($(children[5]).css('display')).to.equal('none');
done();
});
});
});
});