style(test): re-format test case

This commit is contained in:
Nico Rehwaldt 2017-11-23 11:00:23 +01:00
parent a6b26b0b59
commit 9b2a07d958
1 changed files with 17 additions and 2 deletions

View File

@ -950,6 +950,7 @@ describe('Viewer', function() {
describe('#attachTo', function() {
it('should attach the viewer', function(done) {
var xml = require('../fixtures/bpmn/simple.bpmn');
@ -958,17 +959,24 @@ describe('Viewer', function() {
viewer.importXML(xml, function(err, warnings) {
expect(viewer._container.parentNode).to.equal(null);
// assume
expect(viewer._container.parentNode).not.to.exist;
// when
viewer.attachTo(container);
// then
expect(viewer._container.parentNode).to.equal(container);
done(err, warnings);
});
});
});
describe('#detach', function() {
it('should detach the viewer', function(done) {
var xml = require('../fixtures/bpmn/simple.bpmn');
@ -977,12 +985,19 @@ describe('Viewer', function() {
viewer.importXML(xml, function(err, warnings) {
// assume
expect(viewer._container.parentNode).to.equal(container);
// when
viewer.detach();
expect(viewer._container.parentNode).to.equal(null);
// then
expect(viewer._container.parentNode).not.to.exist;
done(err, warnings);
});
});
});
});