Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
electric-el committed Dec 9, 2021
2 parents 1e94983 + ce1a747 commit b385f4c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/unit/viewer-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@ describe('viewerHandler', function () {
// i.e. shrink for .dockLeft(), expand for .dockBottom(), shrink for .dockRight().
it('.dockLeft() docks the codeViewer to the left of the browser', function (done) {
const dockPositionBefore = uiProps.dockPosition;
codeViewer.codeActive = true;

uiFns.sizeIframe(1024);
// Dispatching addClass instead of calling viewerHandler.openViewer()
// because viewerHandler.openViewer() uses setTimeout().
$orgs['#patternlab-body'].dispatchAction('addClass', 'dock-open');

const halfModeBefore = uiProps.halfMode;
const patternlabBodyBefore = $orgs['#patternlab-body'].getState();
Expand Down Expand Up @@ -296,8 +300,12 @@ describe('viewerHandler', function () {
const dockPositionBefore = uiProps.dockPosition;
const halfModeBefore = uiProps.halfMode;
const patternlabBodyBefore = $orgs['#patternlab-body'].getState();
codeViewer.codeActive = true;

uiFns.sizeIframe(1024);
// Dispatching addClass instead of calling viewerHandler.openViewer()
// because viewerHandler.openViewer() uses setTimeout().
$orgs['#patternlab-body'].dispatchAction('addClass', 'dock-open');

const vpWidthBefore = uiProps.vpWidth;

Expand All @@ -324,13 +332,15 @@ describe('viewerHandler', function () {
done();
}, timeout);
});
});

describe('.dockRight()', function () {
it('.dockRight() docks the codeViewer to the right of the browser', function (done) {
const dockPositionBefore = uiProps.dockPosition;
codeViewer.codeActive = true;

uiFns.sizeIframe(1024);
// Dispatching addClass instead of calling viewerHandler.openViewer()
// because viewerHandler.openViewer() uses setTimeout().
$orgs['#patternlab-body'].dispatchAction('addClass', 'dock-open');

const halfModeBefore = uiProps.halfMode;
const vpWidthBefore = uiProps.vpWidth;
Expand Down

0 comments on commit b385f4c

Please sign in to comment.