From 360b7a3b57b7f26f023f979465de7f9d47cc15cb Mon Sep 17 00:00:00 2001 From: lapentafd Date: Tue, 8 Mar 2022 09:25:43 +0000 Subject: Code coverage policy gui react Issue-ID: POLICY-3351 Signed-off-by: lapentafd Change-Id: I5329a7437be4702361940ef9e22f51413ed892d0 --- gui-clamp/ui-react/src/LoopUI.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gui-clamp/ui-react/src/LoopUI.test.js') 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(); + expect(tree).toMatchSnapshot(); + }) }); -- cgit 1.2.3-korg