aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/loop_viewer/logs
diff options
context:
space:
mode:
authorxuegao <xg353y@intl.att.com>2019-10-01 15:34:53 +0200
committerxuegao <xg353y@intl.att.com>2019-10-01 15:34:53 +0200
commit233e3cdba0aec0f0c21cc5986654feb33cb7eb3d (patch)
tree686fa173440210eb34555f458d37c3518a7c4125 /ui-react/src/components/loop_viewer/logs
parent58c7c977bed829fe010849cdf1b3f654c3c8cc02 (diff)
Add react ui tests
Add more tests for react UI. Issue-ID: CLAMP-509 Change-Id: I58f6408bcd8667fa8b16b0b2f31f8287bdfac8c9 Signed-off-by: xuegao <xg353y@intl.att.com>
Diffstat (limited to 'ui-react/src/components/loop_viewer/logs')
-rw-r--r--ui-react/src/components/loop_viewer/logs/LoopLogs.test.js24
1 files changed, 23 insertions, 1 deletions
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(<LoopLogs loopCache={loopCache}/>)
-
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