summaryrefslogtreecommitdiffstats
path: root/docs/guides/onap-developer/how-to-use-docs/git_branches.svg
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-03-19 13:45:31 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-19 13:45:31 +0000
commit05e8e21a9a6a38787a25e6dcc759283a105530f6 (patch)
tree8f77144933f88be378776a08d02a71dd52fd902e /docs/guides/onap-developer/how-to-use-docs/git_branches.svg
parent22968836338d7d740fd5c19159a90fb5ba06138a (diff)
Updated git submodules
Project: so master 66dd44cd8fa96a79d51c548b5b9e78abfc7b622c Merge "Adding Junit" Adding Junit Junit for: 1.MsoRequestsDbExceptionBean.java 2.MsoRequestsDbException.java 3.UpdateInfraRequest.java Sonar Link: https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so%3AMSOCommonBPMN%3Asrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fclient%2Fadapter%2Frequests%2Fdb%2Fentities Change-Id: I7776846e4529bf5d9b6156606df6603f9b5ef79e Issue-ID: SO-492 Signed-off-by: AS00465059 <AS00465059@techmahindra.com>
Diffstat (limited to 'docs/guides/onap-developer/how-to-use-docs/git_branches.svg')
0 files changed, 0 insertions, 0 deletions
bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*-
 * ============LICENSE_START=======================================================
 * ONAP CLAMP
 * ================================================================================
 * Copyright (C) 2019 AT&T Intellectual Property. All rights
 *                             reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END============================================
 * ===================================================================
 *
 */
import React from 'react';
import { shallow } from 'enzyme';
import UserInfoModal from './UserInfoModal';

describe('Verify UserInfoModal', () => {

	beforeEach(() => {
		fetch.resetMocks();
		fetch.mockImplementation(() => {
			return Promise.resolve({
				ok: true,
				status: 200,
				json: () => {
					return Promise.resolve({
						"userName": "test",
						"cldsVersion": "1.0.0"
					});
			}});
		});
	})

	it('Test the render method full permission', () => {
		const component = shallow(<UserInfoModal />)
		component.setState({ userInfo: {
			"userName": "test",
			"cldsVersion": "1.0.0",
			"allPermissions": ["permission1","permission2"]
		}});
		expect(component).toMatchSnapshot();
	});

	it('Test the render method no permission', () => {
		const component = shallow(<UserInfoModal />)
		component.setState({ userInfo: {}
		});

		expect(component.find('FormControl').length).toEqual(0);
	});

	it('Test the render method read permission', () => {
		const component = shallow(<UserInfoModal />)
		component.setState({ userInfo: {
			"userName": "test",
			"cldsVersion": "1.0.0",
			"allPermissions": ["permission1","permission2"]
		}});

		expect(component.find('FormControl').length).toEqual(4);

		const forms = component.find('FormControl');
		expect(forms.get(0).props.defaultValue).toEqual("test");
		expect(forms.get(1).props.defaultValue).toEqual("1.0.0");
		expect(forms.get(2).props.defaultValue).toEqual("permission1");
		expect(forms.get(3).props.defaultValue).toEqual("permission2");
	});
});