Free and Open source Web Builder Framework. Next generation tool for building templates without coding
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

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();
});
});
});