浏览代码

Update tests

Steven Silvester 8 年之前
父节点
当前提交
28c8702b87

+ 20 - 20
test/src/common/observablevector.spec.ts

@@ -53,8 +53,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('add');
           expect(args.type).to.be('add');
           expect(args.newIndex).to.be(0);
           expect(args.newIndex).to.be(0);
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
-          expect(args.newValues.next()).to.be(1);
-          expect(args.oldValues.next()).to.be(void 0);
+          expect(args.newValues.at(0)).to.be(1);
+          expect(args.oldValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.pushBack(1);
         value.pushBack(1);
@@ -100,8 +100,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('set');
           expect(args.type).to.be('set');
           expect(args.newIndex).to.be(1);
           expect(args.newIndex).to.be(1);
           expect(args.oldIndex).to.be(1);
           expect(args.oldIndex).to.be(1);
-          expect(args.oldValues.next()).to.be(2);
-          expect(args.newValues.next()).to.be(4);
+          expect(args.oldValues.at(0)).to.be(2);
+          expect(args.newValues.at(0)).to.be(4);
           called = true;
           called = true;
         });
         });
         value.set(1, 4);
         value.set(1, 4);
@@ -131,8 +131,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('add');
           expect(args.type).to.be('add');
           expect(args.newIndex).to.be(3);
           expect(args.newIndex).to.be(3);
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
-          expect(args.oldValues.next()).to.be(void 0);
-          expect(args.newValues.next()).to.be(4);
+          expect(args.oldValues.length).to.be(0);
+          expect(args.newValues.at(0)).to.be(4);
           called = true;
           called = true;
         });
         });
         value.pushBack(4);
         value.pushBack(4);
@@ -162,8 +162,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('remove');
           expect(args.type).to.be('remove');
           expect(args.newIndex).to.be(-1);
           expect(args.newIndex).to.be(-1);
           expect(args.oldIndex).to.be(2);
           expect(args.oldIndex).to.be(2);
-          expect(args.oldValues.next()).to.be(3);
-          expect(args.newValues.next()).to.be(void 0);
+          expect(args.oldValues.at(0)).to.be(3);
+          expect(args.newValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.popBack();
         value.popBack();
@@ -193,8 +193,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('add');
           expect(args.type).to.be('add');
           expect(args.newIndex).to.be(1);
           expect(args.newIndex).to.be(1);
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
-          expect(args.oldValues.next()).to.be(void 0);
-          expect(args.newValues.next()).to.be(4);
+          expect(args.oldValues.length).to.be(0);
+          expect(args.newValues.at(0)).to.be(4);
           called = true;
           called = true;
         });
         });
         value.insert(1, 4);
         value.insert(1, 4);
@@ -219,8 +219,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('move');
           expect(args.type).to.be('move');
           expect(args.newIndex).to.be(1);
           expect(args.newIndex).to.be(1);
           expect(args.oldIndex).to.be(0);
           expect(args.oldIndex).to.be(0);
-          expect(args.oldValues.next()).to.be(1);
-          expect(args.newValues.next()).to.be(1);
+          expect(args.oldValues.at(0)).to.be(1);
+          expect(args.newValues.at(0)).to.be(1);
           called = true;
           called = true;
         });
         });
         value.move(0, 1);
         value.move(0, 1);
@@ -255,8 +255,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('remove');
           expect(args.type).to.be('remove');
           expect(args.newIndex).to.be(-1);
           expect(args.newIndex).to.be(-1);
           expect(args.oldIndex).to.be(1);
           expect(args.oldIndex).to.be(1);
-          expect(args.oldValues.next()).to.be(2);
-          expect(args.newValues.next()).to.be(void 0);
+          expect(args.oldValues.at(0)).to.be(2);
+          expect(args.newValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.remove(2);
         value.remove(2);
@@ -291,8 +291,8 @@ describe('common/ObservableVector', () => {
           expect(args.type).to.be('remove');
           expect(args.type).to.be('remove');
           expect(args.newIndex).to.be(-1);
           expect(args.newIndex).to.be(-1);
           expect(args.oldIndex).to.be(1);
           expect(args.oldIndex).to.be(1);
-          expect(args.oldValues.next()).to.be(2);
-          expect(args.newValues.next()).to.be(void 0);
+          expect(args.oldValues.at(0)).to.be(2);
+          expect(args.newValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.removeAt(1);
         value.removeAt(1);
@@ -320,7 +320,7 @@ describe('common/ObservableVector', () => {
           expect(args.newIndex).to.be(0);
           expect(args.newIndex).to.be(0);
           expect(args.oldIndex).to.be(0);
           expect(args.oldIndex).to.be(0);
           expect(toArray(args.oldValues)).to.eql([1, 2, 3, 4, 5, 6]);
           expect(toArray(args.oldValues)).to.eql([1, 2, 3, 4, 5, 6]);
-          expect(args.newValues.next()).to.be(void 0);
+          expect(args.newValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.clear();
         value.clear();
@@ -351,7 +351,7 @@ describe('common/ObservableVector', () => {
           expect(args.newIndex).to.be(3);
           expect(args.newIndex).to.be(3);
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
           expect(toArray(args.newValues)).to.eql([4, 5, 6]);
           expect(toArray(args.newValues)).to.eql([4, 5, 6]);
-          expect(args.oldValues.next()).to.be(void 0);
+          expect(args.oldValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.pushAll([4, 5, 6]);
         value.pushAll([4, 5, 6]);
@@ -382,7 +382,7 @@ describe('common/ObservableVector', () => {
           expect(args.newIndex).to.be(1);
           expect(args.newIndex).to.be(1);
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
           expect(toArray(args.newValues)).to.eql([4, 5, 6]);
           expect(toArray(args.newValues)).to.eql([4, 5, 6]);
-          expect(args.oldValues.next()).to.be(void 0);
+          expect(args.oldValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.insertAll(1, [4, 5, 6]);
         value.insertAll(1, [4, 5, 6]);
@@ -413,7 +413,7 @@ describe('common/ObservableVector', () => {
           expect(args.newIndex).to.be(-1);
           expect(args.newIndex).to.be(-1);
           expect(args.oldIndex).to.be(1);
           expect(args.oldIndex).to.be(1);
           expect(toArray(args.oldValues)).to.eql([2, 3]);
           expect(toArray(args.oldValues)).to.eql([2, 3]);
-          expect(args.newValues.next()).to.be(void 0);
+          expect(args.newValues.length).to.be(0);
           called = true;
           called = true;
         });
         });
         value.removeRange(1, 3);
         value.removeRange(1, 3);

+ 0 - 11
test/src/notebook/notebook/default-toolbar.spec.ts

@@ -322,17 +322,6 @@ describe('notebook/notebook/default-toolbar', () => {
         expect(item.node.textContent).to.be('No Kernel!');
         expect(item.node.textContent).to.be('No Kernel!');
       });
       });
 
 
-      it('should handle a change in kernel', (done) => {
-        let item = createKernelNameItem(panel);
-        let name = context.kernelspecs.default;
-        panel.context.changeKernel({ name }).then(kernel => {
-          return kernel.getSpec().then(spec => {
-            expect(item.node.textContent).to.be(spec.display_name);
-            done();
-          });
-        }).catch(done);
-      });
-
       it('should handle a change in context', (done) => {
       it('should handle a change in context', (done) => {
         let item = createKernelNameItem(panel);
         let item = createKernelNameItem(panel);
         panel.kernel.getSpec().then(spec => {
         panel.kernel.getSpec().then(spec => {

+ 2 - 2
test/src/notebook/output-area/model.spec.ts

@@ -92,8 +92,8 @@ describe('notebook/output-area/model', () => {
           expect(args.type).to.be('add');
           expect(args.type).to.be('add');
           expect(args.oldIndex).to.be(-1);
           expect(args.oldIndex).to.be(-1);
           expect(args.newIndex).to.be(0);
           expect(args.newIndex).to.be(0);
-          expect(args.oldValues.next()).to.be(void 0);
-          expect(deepEqual(args.newValues.next() as nbformat.IOutput, DEFAULT_OUTPUTS[0]));
+          expect(args.oldValues.length).to.be(0);
+          expect(deepEqual(args.newValues.at(0) as nbformat.IOutput, DEFAULT_OUTPUTS[0]));
           called = true;
           called = true;
         });
         });
         model.add(DEFAULT_OUTPUTS[0]);
         model.add(DEFAULT_OUTPUTS[0]);