aboutsummaryrefslogtreecommitdiffstats
path: root/gui-clamp/ui-react/src/LoopUI.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'gui-clamp/ui-react/src/LoopUI.test.js')
-rw-r--r--gui-clamp/ui-react/src/LoopUI.test.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/gui-clamp/ui-react/src/LoopUI.test.js b/gui-clamp/ui-react/src/LoopUI.test.js
index 47ade44..083b233 100644
--- a/gui-clamp/ui-react/src/LoopUI.test.js
+++ b/gui-clamp/ui-react/src/LoopUI.test.js
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights
* reserved.
+ * Modifications Copyright (C) 2022 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +30,14 @@ import LoopCache from './api/LoopCache';
import LoopActionService from './api/LoopActionService';
import LoopService from './api/LoopService';
+import { ThemeConsumer } from 'styled-components'
+import { GlobalClampStyle } from './theme/globalStyle.js';
+import { DefaultClampTheme } from './theme/globalStyle.js';
+
+export const shallowWithTheme = (children, theme = DefaultClampTheme) => {
+ ThemeConsumer._currentValue = theme
+ return shallow(children)
+}
describe('Verify LoopUI', () => {
beforeEach(() => {
fetch.resetMocks();
@@ -170,4 +179,9 @@ describe('Verify LoopUI', () => {
expect(component.state('showFailAlert')).toEqual(true);
expect(component.state('showMessage')).toEqual("testAlert2");
})
+
+ test('Test renders correctly Clamp Style', () => {
+ let tree = shallowWithTheme(<GlobalClampStyle />);
+ expect(tree).toMatchSnapshot();
+ })
});