diff options
author | 2021-10-21 12:04:10 +0100 | |
---|---|---|
committer | 2021-10-26 13:24:14 +0100 | |
commit | e433e7621b8c0f235a3e4c67e528afe426e161f4 (patch) | |
tree | 65c5f614a861d693346380dd91a2b1a4a4bfcc35 /gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js | |
parent | aa93fed6146559c521a419a873120bdef479e78f (diff) |
Improved Test Coverage in gui-editor-apex
Issue-ID: POLICY-3351
Change-Id: Iad12ef6340978a2b183d129e65c9a94d6e71d27a
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js')
-rw-r--r-- | gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js index 784c644..f593bd8 100644 --- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.test.js +++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/ApexTaskTab.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. @@ -20,7 +20,26 @@ const mod = require('../ApexTaskTab'); +let data = { + messages: { + message: [ + '{"apexContextSchema": {"key":{"name": "name1", "version": "version1"}}, "apexTask":{"key":{"name": "name1", "version": "version1"},' + + '"taskLogic":{"logicFlavour":"logicFlavour"},"inputFields":{"entry": [{"key":"","value":{"fieldSchemaKey":{"name":"name"}}}]},' + + '"outputFields":{"entry": [{"key":"","value":{"fieldSchemaKey":{"name":"name"}}}]},' + + '"taskParameters":{"entry": [{"key":"","value":{"fieldSchemaKey":{"name":"name"}}}]},'+ + '"contextAlbumReference":[{"name":"name", "version":"version"}]},'+ + '"apexContextAlbum":{"key":{"name": "name1", "version": "version1"}},"apexEvent":{"key":{"name": "name1", "version": "version1"}},' + + '"apexPolicy":{"policyKey":{"name": "name1", "version": "version1"}}, "apexKeyInfo":{"key":{"name": "name1", "version": "version1"}}}' + ] + }, + ok: true +}; + test('test dom : taskTab_activate', () => { + const jqXHR = { status: 200, responseText: "" }; + $.ajax = jest.fn().mockImplementation((args) => { + args.success(data, null, jqXHR); + }); const activate_mock = jest.fn(mod.taskTab_activate); activate_mock(); expect(activate_mock).toBeCalled(); |