Skip to content

Commit

Permalink
Add _addCancelLink test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Jun 21, 2019
1 parent d048bbb commit 74bb9d2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit/step.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,4 +581,20 @@ describe('Tour | Step', () => {
cancelStub.restore();
});
});

describe('_addCancelLink', () => {
it('Cancel link', () => {
const header = document.createElement('header');
const element = document.createElement('div');
const step = new Step(null, { showCancelLink: true });

const cancelLinkStub = stub(step, 'bindCancelLink');

step._addCancelLink(element, header);

expect(cancelLinkStub.called).toBe(true);
expect(element).toHaveClass('shepherd-has-cancel-link');
cancelLinkStub.restore();
});
});
});

0 comments on commit 74bb9d2

Please sign in to comment.