chore: Clean up unused files, imports, and work on getting end-to-end tests and unit tests running (#2272)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-03-01 16:52:54 +01:00
1 parent 414ebc6850
commit 0db81b30f3
374 files changed
+14138 -21288

No files matched your search

@@ -12,11 +12,6 @@ describe('CommandsManager', () => {
options: { passMeToCommandFn: ':wave:' },
},
commandsManagerConfig = {
getAppState: () => {
return {
viewers: 'Test',
};
},
getActiveContexts: () => ['VIEWER', 'ACTIVE_VIEWER::CORNERSTONE'],
};
@@ -34,10 +29,10 @@ describe('CommandsManager', () => {
expect(localCommandsManager.contexts).toEqual({});
});
it('logs a warning if instantiated without getAppState or getActiveContexts', () => {
new CommandsManager();
expect(log.warn.mock.calls.length).toBe(1);
it('throws Error if instantiated without getActiveContexts', () => {
expect(() => {
new CommandsManager();
}).toThrow(new Error('CommandsManager was instantiated without getActiveContexts()'));
});
describe('createContext()', () => {
@@ -180,16 +175,6 @@ describe('CommandsManager', () => {
expect(command.commandFn.mock.calls.length).toBe(1);
});
it('Calls commandFn w/ properties from appState', () => {
commandsManager.registerCommand('VIEWER', 'TestCommand', command);
commandsManager.runCommand('TestCommand', {}, 'VIEWER');
expect(command.commandFn.mock.calls.length).toBe(1);
expect(command.commandFn.mock.calls[0][0].viewers).toEqual(
commandsManagerConfig.getAppState().viewers
);
});
it('Calls commandFn w/ command definition options', () => {
commandsManager.registerCommand('VIEWER', 'TestCommand', command);
commandsManager.runCommand('TestCommand', {}, 'VIEWER');