1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-24 05:43:25 +02:00

Reorganizing tests

This commit is contained in:
displaynone
2017-05-15 15:26:48 +02:00
parent 2fb8c1e816
commit c82fd6507a
10 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import DOM from '../../src/js/utils/dom';
import ClickNav from '../../src/js/plugins/click-nav';
beforeAll(() => {
document.body.innerHTML = `<div id="webslides" data-test="test"><p>Text</p></div>`;
});
test('Click nav plugin', () => {
const next = jest.fn();
const ws = document.getElementById('webslides');
// Simulates dataset
ws.dataset = {};
const webslides = {
options: {
changeOnClick: true
},
goNext: next,
el: ws
};
expect(next).not.toBeCalled();
const clicknav = new ClickNav(webslides);
DOM.fireEvent(ws, 'click');
expect(next.mock.calls.length).toBe(1);
});