|
@@ -944,27 +944,17 @@ describe('notebook/widget', () => {
|
|
|
|
|
|
context('blur', () => {
|
|
|
|
|
|
- it('should preserve the mode', () => {
|
|
|
+ it('should set the mode to command', () => {
|
|
|
simulate(widget.node, 'focus');
|
|
|
widget.mode = 'edit';
|
|
|
let other = document.createElement('div');
|
|
|
simulate(widget.node, 'blur', { relatedTarget: other });
|
|
|
- expect(widget.mode).to.be('edit');
|
|
|
+ expect(widget.mode).to.be('command');
|
|
|
MessageLoop.sendMessage(widget, Widget.Msg.ActivateRequest);
|
|
|
expect(widget.mode).to.be('edit');
|
|
|
expect(widget.activeCell.editor.hasFocus()).to.be(true);
|
|
|
});
|
|
|
|
|
|
- it('should give focus back to the notebook', () => {
|
|
|
- simulate(widget.node, 'focus');
|
|
|
- let other = document.createElement('div');
|
|
|
- simulate(widget.node, 'blur', { relatedTarget: other });
|
|
|
- expect(widget.mode).to.be('command');
|
|
|
- MessageLoop.sendMessage(widget, Widget.Msg.ActivateRequest);
|
|
|
- expect(widget.mode).to.be('command');
|
|
|
- expect(widget.activeCell.editor.hasFocus()).to.be(false);
|
|
|
- });
|
|
|
-
|
|
|
});
|
|
|
|
|
|
});
|