import { DyNTS_AppExtSysControls } from './app-ext-system-controls.control-model'; import { DyNTS_SystemControl } from './system-control.control-model'; describe('| DyNTS_AppExtSysControls', () => { let appExtSysControls: DyNTS_AppExtSysControls; beforeEach(() => { appExtSysControls = new DyNTS_AppExtSysControls(); }); it('| should create an instance of DyNTS_AppExtSysControls', () => { expect(appExtSysControls).toBeTruthy(); }); it('| should initialize "appExtended" as an instance of DyNTS_SystemControl', () => { expect(appExtSysControls.appExtended).toBeInstanceOf(DyNTS_SystemControl); }); it('| should initialize "httpSocketServer" as an instance of DyNTS_SystemControl', () => { expect(appExtSysControls.httpSocketServer).toBeInstanceOf(DyNTS_SystemControl); }); it('| should initialize "httpsSocketServer" as an instance of DyNTS_SystemControl', () => { expect(appExtSysControls.httpsSocketServer).toBeInstanceOf(DyNTS_SystemControl); }); it('| should have independent SystemControl instances', () => { expect(appExtSysControls.appExtended).not.toBe(appExtSysControls.httpSocketServer); expect(appExtSysControls.appExtended).not.toBe(appExtSysControls.httpsSocketServer); expect(appExtSysControls.httpSocketServer).not.toBe(appExtSysControls.httpsSocketServer); }); it('| should allow setting init and started on appExtended', () => { appExtSysControls.appExtended.init = true; appExtSysControls.appExtended.started = true; expect(appExtSysControls.appExtended.getIsReady()).toBeTrue(); }); it('| should allow setting init and started on httpSocketServer', () => { appExtSysControls.httpSocketServer.init = true; appExtSysControls.httpSocketServer.started = false; expect(appExtSysControls.httpSocketServer.getIsReady()).toBeFalse(); }); it('| should allow setting init and started on httpsSocketServer', () => { appExtSysControls.httpsSocketServer.init = true; appExtSysControls.httpsSocketServer.started = true; expect(appExtSysControls.httpsSocketServer.getIsReady()).toBeTrue(); }); });