Example #1
0
 it('should give the appropriate caption given arguments', () => {
   let cmd = {
     execute: (args: JSONObject) => { return args; },
     caption: (args: JSONObject) => { return JSON.stringify(args); }
   };
   registry.addCommand('test', cmd);
   expect(registry.caption('test', {})).to.equal('{}');
 });
Example #2
0
 it('should get the caption for a specific command', () => {
   let cmd = {
     execute: (args: JSONObject) => { return args; },
     caption: 'foo'
   };
   registry.addCommand('test', cmd);
   expect(registry.caption('test')).to.equal('foo');
 });
Example #3
0
 function commandTooltip(commands: CommandRegistry, id: string): string {
   return commands.caption(id);
 }
Example #4
0
 it('should default to an empty string for a command', () => {
   registry.addCommand('test', NULL_COMMAND);
   expect(registry.caption('test')).to.equal('');
 });
Example #5
0
 it('should return an empty string if the command is not registered', () => {
   expect(registry.caption('foo')).to.equal('');
 });