Stackedit/test/unit/specs/components/ButtonBar.spec.js

48 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-06-07 23:56:11 +00:00
import ButtonBar from '../../../../src/components/ButtonBar';
import store from '../../../../src/store';
import specUtils from '../specUtils';
describe('ButtonBar.vue', () => {
it('should toggle the navigation bar', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--navigation-bar-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].showNavigationBar,
'toggleNavigationBar',
2018-06-07 23:56:11 +00:00
));
it('should toggle the side preview', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--side-preview-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].showSidePreview,
'toggleSidePreview',
2018-06-07 23:56:11 +00:00
));
it('should toggle the editor', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--editor-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].showEditor,
'toggleEditor',
2018-06-07 23:56:11 +00:00
));
it('should toggle the focus mode', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--focus-mode-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].focusMode,
'toggleFocusMode',
2018-06-07 23:56:11 +00:00
));
it('should toggle the scroll sync', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--scroll-sync-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].scrollSync,
'toggleScrollSync',
2018-06-07 23:56:11 +00:00
));
it('should toggle the status bar', async () => specUtils.checkToggler(
2018-06-07 23:56:11 +00:00
ButtonBar,
wrapper => wrapper.find('.button-bar__button--status-bar-toggler').trigger('click'),
() => store.getters['data/layoutSettings'].showStatusBar,
'toggleStatusBar',
2018-06-07 23:56:11 +00:00
));
});