diff options
author | liamfallon <liam.fallon@est.tech> | 2021-11-09 15:22:22 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2021-11-10 08:57:23 +0000 |
commit | 2022e5ce5a03788a6edc5761c495cfadc5ded485 (patch) | |
tree | 2df93f088fb323440945ce93ce67be1f2208c9bf /runtime/ui-react/src/components/dialogs/UserInfoModal.test.js | |
parent | 579085240812aa593ebafe787d97868e16fc3318 (diff) |
Align ui-react file in policy-clamp and policy-gui
When the ui-react code was transferred to policy-gui, the white space
was cleaned up and reformatted. This makes it difficult to track the
real functional changes if any between ui-react in policy-clamp and
policy-gui.
This review brings the white space changes into ui-react in policy-clamp
to make file comparisons easier.
Issue-ID: POLICY-3358
Change-Id: Ic303e71b341e5c0f7ca0de0ed4c4962ebf2f988a
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'runtime/ui-react/src/components/dialogs/UserInfoModal.test.js')
-rw-r--r-- | runtime/ui-react/src/components/dialogs/UserInfoModal.test.js | 92 |
1 files changed, 49 insertions, 43 deletions
diff --git a/runtime/ui-react/src/components/dialogs/UserInfoModal.test.js b/runtime/ui-react/src/components/dialogs/UserInfoModal.test.js index f5ed0ae10..716879232 100644 --- a/runtime/ui-react/src/components/dialogs/UserInfoModal.test.js +++ b/runtime/ui-react/src/components/dialogs/UserInfoModal.test.js @@ -26,53 +26,59 @@ 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" - }); - }}); - }); - }) + 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 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: {} - }); + it('Test the render method no permission', () => { + const component = shallow(<UserInfoModal/>) + component.setState({ + userInfo: {} + }); - expect(component.find('FormControl').length).toEqual(0); - }); + 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"] - }}); + 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); + 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"); - }); + 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"); + }); }); |