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', () => {
|
2019-06-29 16:33:21 +00:00
|
|
|
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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleNavigationBar',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
|
2019-06-29 16:33:21 +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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleSidePreview',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
|
2019-06-29 16:33:21 +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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleEditor',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
|
2019-06-29 16:33:21 +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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleFocusMode',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
|
2019-06-29 16:33:21 +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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleScrollSync',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
|
2019-06-29 16:33:21 +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,
|
2019-06-29 16:33:21 +00:00
|
|
|
'toggleStatusBar',
|
2018-06-07 23:56:11 +00:00
|
|
|
));
|
|
|
|
});
|