Pārlūkot izejas kodu

Added checks in test-notebook

Adityar Rayala 5 gadi atpakaļ
vecāks
revīzija
0ac8f2c111
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  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;