Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should create a new message', () => {
const message = new ObservableJSON.ChangeMessage('jsonvalue-changed', {
key: 'foo',
type: 'add',
oldValue: 1,
newValue: 2
});
expect(message).to.be.an.instanceof(ObservableJSON.ChangeMessage);
});
});
it('should be the args of the message', () => {
const args: IObservableJSON.IChangedArgs = {
key: 'foo',
type: 'add',
oldValue: 'ho',
newValue: 'hi'
};
const message = new ObservableJSON.ChangeMessage(
'jsonvalue-changed',
args
);
expect(message.args).to.equal(args);
});
});
private _onActiveCellMetadataChanged(
sender: IObservableMap,
args: IObservableMap.IChangedArgs
): void {
let message = new ObservableJSON.ChangeMessage(
'activecell-metadata-changed',
args
);
each(this._toolChildren(), widget => {
MessageLoop.sendMessage(widget, message);
});
}
private _onActiveCellMetadataChanged(
sender: IObservableMap,
args: IObservableMap.IChangedArgs
): void {
let message = new ObservableJSON.ChangeMessage(
'activecell-metadata-changed',
args
);
each(this._toolChildren(), widget => {
MessageLoop.sendMessage(widget, message);
});
}
private _onActiveNotebookPanelMetadataChanged(
sender: IObservableMap,
args: IObservableMap.IChangedArgs
): void {
let message = new ObservableJSON.ChangeMessage(
'activenotebookpanel-metadata-changed',
args
);
each(this._toolChildren(), widget => {
MessageLoop.sendMessage(widget, message);
});
}
private _onActiveNotebookPanelMetadataChanged(
sender: IObservableMap,
args: IObservableMap.IChangedArgs
): void {
let message = new ObservableJSON.ChangeMessage(
'activenotebookpanel-metadata-changed',
args
);
each(this._toolChildren(), widget => {
MessageLoop.sendMessage(widget, message);
});
}