mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
727 B
29 lines
727 B
import SwitchVisibility from 'commands/view/SwitchVisibility';
|
|
|
|
describe('SwitchVisibility command', () => {
|
|
let fakeEditor, fakeFrames, fakeIsActive;
|
|
|
|
beforeEach(() => {
|
|
fakeFrames = [];
|
|
fakeIsActive = false;
|
|
|
|
fakeEditor = {
|
|
Canvas: {
|
|
getFrames: jest.fn(() => fakeFrames),
|
|
},
|
|
|
|
Commands: {
|
|
isActive: jest.fn(() => fakeIsActive),
|
|
},
|
|
};
|
|
});
|
|
|
|
describe('.toggleVis', () => {
|
|
it('should do nothing if the preview command is active', () => {
|
|
expect(fakeEditor.Canvas.getFrames).not.toHaveBeenCalled();
|
|
fakeIsActive = true;
|
|
SwitchVisibility.toggleVis(fakeEditor);
|
|
expect(fakeEditor.Canvas.getFrames).not.toHaveBeenCalled();
|
|
});
|
|
});
|
|
});
|
|
|