浏览代码

Added checks in test-notebook

Adityar Rayala 5 年之前
父节点
当前提交
0ac8f2c111
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      tests/test-notebook/src/actions.spec.ts

+ 6 - 3
tests/test-notebook/src/actions.spec.ts

@@ -919,7 +919,9 @@ describe('@jupyterlab/notebook', () => {
       it('should extend the selection to the topmost cell', () => {
         widget.activeCellIndex = 1;
         NotebookActions.extendSelectionAbove(widget, true);
-        expect(widget.isSelected(widget.widgets[0])).to.equal(true);
+        for (let i = widget.activeCellIndex; i >= 0; i--) {
+          expect(widget.isSelected(widget.widgets[i])).to.equal(true);
+        }
       });
 
       it('should be a no-op if there is no model', () => {
@@ -976,8 +978,9 @@ describe('@jupyterlab/notebook', () => {
 
       it('should extend the selection the bottomost cell', () => {
         NotebookActions.extendSelectionBelow(widget, true);
-        expect(widget.isSelected(widget.widgets[0])).to.equal(true);
-        expect(widget.isSelected(widget.widgets[1])).to.equal(true);
+        for (let i = widget.activeCellIndex; i < widget.widgets.length; i++) {
+          expect(widget.isSelected(widget.widgets[i])).to.equal(true);
+        }
       });
       it('should be a no-op if there is no model', () => {
         widget.model = null;