Skip to content

Commit

Permalink
test(overlays): verify Overlays#isShown behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Dec 12, 2022
1 parent d44da08 commit 07e28f0
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/spec/features/overlays/OverlaysSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,43 @@ describe('features/overlays', function() {
});


describe('#isShown', function() {

beforeEach(bootstrapDiagram({ modules: [ overlayModule ] }));


it('should show per default', inject(function(overlays) {

// then
expect(overlays.isShown()).to.be.true;
}));


it('hide on changing canvas', inject(function(overlays, eventBus) {

// when
eventBus.fire('canvas.viewbox.changing');

// then
expect(overlays.isShown()).not.to.be.true;
}));


it('show after canvas changed', inject(function(overlays, eventBus, canvas) {

// given
eventBus.fire('canvas.viewbox.changing');

// when
eventBus.fire('canvas.viewbox.changed', { viewbox: canvas.viewbox() });

// then
expect(overlays.isShown()).to.be.true;
}));

});


describe('positioning', function() {

beforeEach(bootstrapDiagram({ modules: [ overlayModule ] }));
Expand Down

0 comments on commit 07e28f0

Please sign in to comment.