From 233e3cdba0aec0f0c21cc5986654feb33cb7eb3d Mon Sep 17 00:00:00 2001 From: xuegao Date: Tue, 1 Oct 2019 15:34:53 +0200 Subject: Add react ui tests Add more tests for react UI. Issue-ID: CLAMP-509 Change-Id: I58f6408bcd8667fa8b16b0b2f31f8287bdfac8c9 Signed-off-by: xuegao --- .../components/loop_viewer/logs/LoopLogs.test.js | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'ui-react/src/components/loop_viewer/logs') diff --git a/ui-react/src/components/loop_viewer/logs/LoopLogs.test.js b/ui-react/src/components/loop_viewer/logs/LoopLogs.test.js index 3c76405c..5c478f6a 100644 --- a/ui-react/src/components/loop_viewer/logs/LoopLogs.test.js +++ b/ui-react/src/components/loop_viewer/logs/LoopLogs.test.js @@ -42,7 +42,29 @@ describe('Verify LoopLogs', () => { it('Test the render method', () => { const component = shallow() - expect(component).toMatchSnapshot(); + + const loopCacheUpdated = new LoopCache({ + "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca", + "loopLogs": [ + { + "id": 1, + "logType": "INFO", + "logComponent": "CLAMP", + "message": "Operational and Guard policies UPDATED", + "logInstant": "2019-07-08T09:44:37Z" + }, + { + "id": 2, + "logType": "INFO", + "logComponent": "CLAMP", + "message": "Operational and Guard policies UPDATED", + "logInstant": "2019-07-08T09:44:50Z" + } + ] + }); + + component.setProps({ loopCache: loopCacheUpdated }); + expect(component.find('TableRow').length).toEqual(2); }); }); \ No newline at end of file -- cgit 1.2.3-korg