|
@@ -7,11 +7,25 @@ import {
|
|
|
ISignal, defineSignal
|
|
|
} from 'phosphor/lib/core/signaling';
|
|
|
|
|
|
+import {
|
|
|
+ Widget
|
|
|
+} from 'phosphor/lib/ui/widget';
|
|
|
+
|
|
|
import {
|
|
|
Inspector
|
|
|
} from '../../../lib/inspector';
|
|
|
|
|
|
|
|
|
+class TestInspector extends Inspector {
|
|
|
+ methods: string[] = [];
|
|
|
+
|
|
|
+ protected onInspectorUpdate(sender: any, args: Inspector.IInspectorUpdate): void {
|
|
|
+ super.onInspectorUpdate(sender, args);
|
|
|
+ this.methods.push('onInspectorUpdate');
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
class TestInspectable implements Inspector.IInspectable {
|
|
|
disposed: ISignal<any, void>;
|
|
|
|
|
@@ -97,6 +111,23 @@ describe('inspector/index', () => {
|
|
|
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ describe('#onInspectorUpdate()', () => {
|
|
|
+
|
|
|
+ it('should fire when a source updates', () => {
|
|
|
+ let options: Inspector.IOptions = {};
|
|
|
+ let widget = new TestInspector(options);
|
|
|
+ widget.source = new TestInspectable();
|
|
|
+ expect(widget.methods).to.not.contain('onInspectorUpdate');
|
|
|
+ widget.source.inspected.emit({
|
|
|
+ content: new Widget(),
|
|
|
+ type: 'hints'
|
|
|
+ });
|
|
|
+ expect(widget.methods).to.contain('onInspectorUpdate');
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
});
|