summaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js
diff options
context:
space:
mode:
authorlapentafd <francesco.lapenta@est.tech>2022-01-26 17:37:12 +0000
committerlapentafd <francesco.lapenta@est.tech>2022-02-02 11:41:41 +0000
commit02311dcd02872c548418d51eb770a08b3f32e18f (patch)
tree4bedad50a57a3cc52674e31f580edfc75c1f4f58 /gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js
parent9957cf988f2199d9d0ff3838e7f90e70d9cb6ae8 (diff)
Policy Gui Code Coverage
Adding Generated tag for lombok methods in ApexEditorParameters This will skip the sonar check on the @Data methods Issue-ID: POLICY-3351 Signed-off-by: lapentafd <francesco.lapenta@est.tech> Change-Id: I73ec9f47fb90182221aebd5129bf2da32ab06cad
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js')
-rw-r--r--gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js
index 5f85a70..6b2bfa5 100644
--- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js
+++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/__test__/showhideElement.test.js
@@ -29,8 +29,11 @@ test('Test editTaskForm_activate CREATE', () => {
test('Test editTaskForm_activate NO CHECKBOX', () => {
const mock_activate = jest.fn(mod.showHideElement_display);
- let documentSpy = jest.spyOn(document, 'getElementById');
- mock_activate(documentSpy, null, null, 'hidestyle', 'buttonshowStyle','buttonhideStyle');
+ spyOn($.fn, "find").and.returnValue(false);
+ const mockedElementDOM = { classList: { contains: jest.fn(), remove: jest.fn(), add: jest.fn() } };
+ mockedElementDOM.classList.contains.mockReturnValueOnce(true);
+ mockedElementDOM.classList.remove.mockReturnValueOnce(true);
+ mock_activate(mockedElementDOM, 'element', 'style', 'hidestyle', 'buttonshowStyle','buttonhideStyle');
expect(mock_activate).toBeCalled();
});