Skip to content

Commit

Permalink
Merge pull request #3 from theia-demo-plugins/CHE-9284
Browse files Browse the repository at this point in the history
CHE-9284 add tests for messages API
  • Loading branch information
olexii4 authored May 8, 2018
2 parents 05bd891 + ed1f956 commit 1d52598
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,56 @@ export function start() {
}
disposables.push(theia.commands.registerCommand(quickPickTestObjCommand, (...args: any[]) => testQuickPickObject()));

const informationMessageTestCommand = {
id: 'frontend-plugin-information-message-command',
label: "Test Information Message Item"
};
disposables.push(theia.commands.registerCommand(informationMessageTestCommand, (...args: any[]) => {
theia.window.showInformationMessage('Information message!');
}));

const informationModalMessageTestCommand = {
id: 'frontend-plugin-information-modal-message-command',
label: "Test Information Modal Message Item"
};
disposables.push(theia.commands.registerCommand(informationModalMessageTestCommand, (...args: any[]) => {
theia.window.showInformationMessage('Information modal message!', {modal: true}, {title: 'action1'},
{title: 'action2', isCloseAffordance: true}, {title: 'action3'}).then(action => {
console.log('>>> resolve', action);
});
}));

const warningMessageTestCommand = {
id: 'frontend-plugin-warning-message-command',
label: "Test Warning Message Item"
};
disposables.push(theia.commands.registerCommand(warningMessageTestCommand, (...args: any[]) => {
theia.window.showWarningMessage('Warning message!');
}));

const warningModalMessageTestCommand = {
id: 'frontend-plugin-warning-modal-message-command',
label: "Test Warning Modal Message Item"
};
disposables.push(theia.commands.registerCommand(warningModalMessageTestCommand, (...args: any[]) => {
theia.window.showWarningMessage('Warning modal message!', {modal: true});
}));

const errorMessageTestCommand = {
id: 'frontend-plugin-error-message-command',
label: "Test Error Message Item"
};
disposables.push(theia.commands.registerCommand(errorMessageTestCommand, (...args: any[]) => {
theia.window.showErrorMessage('Error message!');
}));

const errorModalMessageTestCommand = {
id: 'frontend-plugin-error-modal-message-command',
label: "Test Error Modal Message Item"
};
disposables.push(theia.commands.registerCommand(errorModalMessageTestCommand, (...args: any[]) => {
theia.window.showErrorMessage('Error modal message!', {modal: true});
}));
}

function testQuickPickObject() {
Expand Down

0 comments on commit 1d52598

Please sign in to comment.