diff options
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js')
-rw-r--r-- | gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js index 1f1767a..8dd9fc4 100644 --- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js +++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexPolicyEditForm_State.test.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020 Nordix Foundation + * Copyright (C) 2020-2021 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,6 +117,37 @@ test('Test editPolicyForm_State_addPolicyTask', () => { }); -test.todo('Test editPolicyForm_State_getDirectOutputMappingOptions'); -test.todo('Test editPolicyForm_State_getStateBean'); -test.todo('Test editPolicyForm_State_getLogicOutputMappingOptions');
\ No newline at end of file +test('Test editPolicyForm_State_getDirectOutputMappingOptions', () => { + let documentSpy = jest.spyOn(document, 'getElementById'); + let elementMock = document.createElement("editPolicyFormDirOutputsTable_stateName"); + elementMock.rows = '1' + documentSpy.mockReturnValue(elementMock); + const mock_activate = jest.fn(mod.editPolicyForm_State_getDirectOutputMappingOptions); + mock_activate('stateName'); + expect(mock_activate).toBeCalled(); + +}); + +test('Test editPolicyForm_State_getStateBean', () => { + let documentSpy = jest.spyOn(document, 'getElementById'); + let elementMock = document.createElement("editPolicyFormDirOutputsTable_stateName"); + elementMock.rows = '1' + documentSpy.mockReturnValue(elementMock); + const mock_activate = jest.fn(mod.editPolicyForm_State_getStateBean); + mock_activate('stateName'); + expect(mock_activate).toBeCalled(); + +}); + +test('Test editPolicyForm_State_getStateBean StateName is Null', () => { + const mock_activate = jest.fn(mod.editPolicyForm_State_getStateBean); + mock_activate(null); + expect(mock_activate).toBeCalled(); + +}); + +test('Test editPolicyForm_State_getLogicOutputMappingOptions', () => { + const mock_activate = jest.fn(mod.editPolicyForm_State_getLogicOutputMappingOptions); + mock_activate(null); + expect(mock_activate).toBeCalled(); +});
\ No newline at end of file |