Browse Source

Fix broken tests.

Afshin Darian 8 years ago
parent
commit
4f2c083074

+ 1 - 4
test/src/apputils/layoutrestorer.spec.ts

@@ -149,10 +149,7 @@ describe('apputils', () => {
     describe('#restore()', () => {
 
       it('should restore the widgets in a tracker', done => {
-        let tracker = new InstanceTracker<Widget>({
-          namespace: 'foo-widget',
-          shell: new ApplicationShell()
-        });
+        let tracker = new InstanceTracker<Widget>({ namespace: 'foo-widget' });
         let registry = new CommandRegistry();
         let state = new StateDB({ namespace: NAMESPACE });
         let ready = new PromiseDelegate<void>();

+ 1 - 1
test/src/apputils/statedb.spec.ts

@@ -5,7 +5,7 @@ import expect = require('expect.js');
 
 import {
   StateDB
-} from '@jupyterlab/apputils';
+} from '@jupyterlab/coreutils';
 
 
 describe('StateDB', () => {

+ 1 - 5
test/src/filebrowser/model.spec.ts

@@ -5,7 +5,7 @@ import expect = require('expect.js');
 
 import {
   StateDB
-} from '@jupyterlab/apputils';
+} from '@jupyterlab/coreutils';
 
 import {
   DocumentManager, IDocumentManager
@@ -19,10 +19,6 @@ import {
   ServiceManager, Session
 } from '@jupyterlab/services';
 
-import {
-  toArray
-} from '@phosphor/algorithm';
-
 import {
   FileBrowserModel
 } from '@jupyterlab/filebrowser';

+ 1 - 8
test/src/notebook/celltools.spec.ts

@@ -15,10 +15,6 @@ import {
   simulate
 } from 'simulate-event';
 
-import {
-  ApplicationShell
-} from '@jupyterlab/application';
-
 import {
   CodeMirrorEditorFactory
 } from '@jupyterlab/codemirror';
@@ -103,10 +99,7 @@ describe('notebook/celltools', () => {
   let panel1: NotebookPanel;
 
   beforeEach((done) => {
-    tracker = new NotebookTracker({
-      namespace: 'notebook',
-      shell: new ApplicationShell()
-    });
+    tracker = new NotebookTracker({ namespace: 'notebook' });
     panel0 = createNotebookPanel();
     populateNotebook(panel0.notebook);
     panel1 = createNotebookPanel();

+ 6 - 11
test/src/notebook/tracker.spec.ts

@@ -3,10 +3,6 @@
 
 import expect = require('expect.js');
 
-import {
-  ApplicationShell
-} from '@jupyterlab/application';
-
 import {
   Cell
 } from '@jupyterlab/cells';
@@ -29,7 +25,6 @@ import {
 
 
 const namespace = 'notebook-tracker-test';
-const shell = new ApplicationShell();
 
 
 class TestTracker extends NotebookTracker {
@@ -63,7 +58,7 @@ describe('notebook/tracker', () => {
     describe('#constructor()', () => {
 
       it('should create a NotebookTracker', () => {
-        let tracker = new NotebookTracker({ namespace, shell });
+        let tracker = new NotebookTracker({ namespace });
         expect(tracker).to.be.a(NotebookTracker);
       });
 
@@ -72,19 +67,19 @@ describe('notebook/tracker', () => {
     describe('#activeCell', () => {
 
       it('should be `null` if there is no tracked notebook panel', () => {
-        let tracker = new NotebookTracker({ namespace, shell });
+        let tracker = new NotebookTracker({ namespace });
         expect(tracker.activeCell).to.be(null);
       });
 
       it('should be `null` if a tracked notebook has no active cell', () => {
-        let tracker = new NotebookTracker({ namespace, shell });
+        let tracker = new NotebookTracker({ namespace });
         let panel = createNotebookPanel();
         tracker.add(panel);
         expect(tracker.activeCell).to.be(null);
       });
 
       it('should be the active cell if a tracked notebook has one', () => {
-        let tracker = new NotebookTracker({ namespace, shell });
+        let tracker = new NotebookTracker({ namespace });
         let panel = createNotebookPanel();
         tracker.add(panel);
         panel.context = context;
@@ -98,7 +93,7 @@ describe('notebook/tracker', () => {
     describe('#activeCellChanged', () => {
 
       it('should emit a signal when the active cell changes', () => {
-        let tracker = new NotebookTracker({ namespace, shell });
+        let tracker = new NotebookTracker({ namespace });
         let panel = createNotebookPanel();
         let count = 0;
         tracker.activeCellChanged.connect(() => { count++; });
@@ -116,7 +111,7 @@ describe('notebook/tracker', () => {
     describe('#onCurrentChanged()', () => {
 
       it('should be called when the active cell changes', () => {
-        let tracker = new TestTracker({ namespace, shell });
+        let tracker = new TestTracker({ namespace });
         let panel = createNotebookPanel();
         tracker.add(panel);
         expect(tracker.methods).to.contain('onCurrentChanged');