Skip to content

Commit 371664c

Browse files
committed
Merge branch 'formatting' into 'main'
Update formatting/copyright See merge request cit/mathworks/jupyter-matlab-proxy!11
2 parents 28172cb + 1dfec69 commit 371664c

36 files changed

+724
-629
lines changed

gui/src/actionCreators/actionCreators.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 The MathWorks, Inc.
1+
// Copyright 2020-2021 The MathWorks, Inc.
22

33
import configureMockStore from 'redux-mock-store';
44
import thunk from 'redux-thunk';
@@ -14,17 +14,17 @@ const mockStore = configureMockStore(middlewares);
1414
describe.each([
1515
[actionCreators.setTutorialHidden, [true], {type:actions.SET_TUTORIAL_HIDDEN, hidden:true}],
1616
[actionCreators.setTutorialHidden, [false], {type:actions.SET_TUTORIAL_HIDDEN, hidden:false}],
17-
[actionCreators.setOverlayVisibility, [true], {type:actions.SET_OVERLAY_VISIBILITY, visibility:true}],
17+
[actionCreators.setOverlayVisibility, [true], {type:actions.SET_OVERLAY_VISIBILITY, visibility:true}],
1818
[actionCreators.setOverlayVisibility, [false], {type:actions.SET_OVERLAY_VISIBILITY, visibility:false}],
1919
[actionCreators.setTriggerPosition, [12,12], {type:actions.SET_TRIGGER_POSITION, x:12, y:12}],
2020
[actionCreators.setTriggerPosition, [52,112], {type:actions.SET_TRIGGER_POSITION, x:52, y:112}],
2121
])('Test Set actionCreators', (method, input, expectedAction) => {
2222
test(`check if an action of type ${expectedAction.type} is returned when method actionCreator.${method.name}() is called`, () => {
23-
expect(method(...input)).toEqual(expectedAction);
23+
expect(method(...input)).toEqual(expectedAction);
2424
});
25-
});
25+
});
26+
2627

27-
2828
describe.each([
2929
[actionCreators.requestServerStatus, {type:actions.REQUEST_SERVER_STATUS, fetchAbortController:new AbortController()}],
3030
[actionCreators.requestSetLicensing, {type:actions.REQUEST_SET_LICENSING, fetchAbortController:new AbortController()}],
@@ -40,24 +40,24 @@ describe.each([
4040

4141
test(`check if an action of type ${expectedAction.type} is returned with an AbortController when method actionCreator.${method.name}() is called`, () => {
4242
expect(method(abortController)).toEqual(expectedAction);
43-
43+
4444
});
45-
});
45+
});
46+
4647

47-
4848
describe.each([
4949
[actionCreators.receiveSetLicensing, {type: 'MHLM'}, {type:actions.RECEIVE_SET_LICENSING, status:{type:'MHLM'}}],
5050
[actionCreators.receiveStopMatlab,{matlabStatus:'down'}, {type:actions.RECEIVE_STOP_MATLAB, status:{matlabStatus:'down'}}],
5151
[actionCreators.receiveStartMatlab,{matlabStatus:'up'}, {type:actions.RECEIVE_START_MATLAB, status:{matlabStatus:'up'}}],
52-
[actionCreators.receiveError, {message:'ERROR: License Manager Error -9', logs: null}, {type:actions.RECEIVE_ERROR, error: {message:'ERROR: License Manager Error -9', logs: null}}],
52+
[actionCreators.receiveError, {message:'ERROR: License Manager Error -9', logs: null}, {type:actions.RECEIVE_ERROR, error: {message:'ERROR: License Manager Error -9', logs: null}}],
5353
[actionCreators.receiveTerminateIntegration,{licensing:{}}, {type:actions.RECEIVE_TERMINATE_INTEGRATION, status:{licensing:{}}, loadUrl:'../'}],
5454
])('Test Receive actionCreators', (method, input, expectedAction) => {
5555

5656
test(`check if an action of type ${expectedAction.type} is returned when method actionCreator.${method.name}() is called`, () => {
5757
expect(method(input)).toEqual(expectedAction);
58-
58+
5959
});
60-
});
60+
});
6161

6262

6363

gui/src/components/App/App.spec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 The MathWorks, Inc.
1+
// Copyright 2020-2021 The MathWorks, Inc.
22

33
import React from 'react';
44
import { render, fireEvent, within } from '../../test/utils/react-test';
@@ -62,32 +62,32 @@ describe('App Component', () => {
6262
});
6363

6464
it('should render LicensingGatherer component within the App component when no licensing is provided', () => {
65-
65+
6666
//Set lincensingInfo to empty object.
6767
initialState.serverStatus.licensingInfo = {};
6868
initialState.overlayVisibility = true;
6969

7070
const { getByRole } = render(<App />, {
7171
initialState: initialState,
7272
});
73-
73+
7474
const licensingGathererComponent = getByRole(
7575
'document'
7676
);
7777
expect(licensingGathererComponent).toBeInTheDocument();
7878
});
7979

8080
it('should render Information Component within App Component after licensing is provided', () => {
81-
82-
// Hide the tutorial and make the overlay visible.
81+
82+
// Hide the tutorial and make the overlay visible.
8383
initialState.tutorialHidden = true;
8484
initialState.overlayVisibility = true;
85-
85+
8686
//Rendering the App component with the above changes to the initial
8787
// state should render the Information Component.
8888
const { getByRole } = render(<App />, {
8989
initialState: initialState,
90-
});
90+
});
9191

9292
const informationComponent = getByRole('document');
9393
expect(informationComponent).toBeInTheDocument();
@@ -105,11 +105,11 @@ describe('App Component', () => {
105105
const { container } = render(<App />, {
106106
initialState: initialState,
107107
});
108-
108+
109109

110110
const paragraphElements = [...container.getElementsByTagName('p')];
111111

112-
112+
113113
expect(
114114
paragraphElements.some((p) =>
115115
p.textContent.includes('integration terminated')
@@ -172,22 +172,22 @@ describe('App Component', () => {
172172
const { getByTestId, container, getByRole } = render(<App />, {
173173
initialState: initialState,
174174
});
175-
175+
176176

177177
// Grab the help button and click it.
178178
const helpBtn = getByTestId('helpBtn');
179179
fireEvent.click(helpBtn);
180180

181181
const helpElement = container.querySelector('#confirmation-dialog-title');
182-
182+
183183
expect(helpElement.textContent).toMatch('Help');
184184
});
185185

186186
it('should set the window location from state', () => {
187187
initialState.loadUrl = 'http://localhost.com:5555';
188188
const hrefMock = jest.fn();
189189
delete window.location;
190-
190+
191191
window.location = {href : hrefMock}
192192
const { debug } = render(<App />, { initialState: initialState });
193193

gui/src/components/Confirmation/Confirmation.spec.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2021 The MathWorks, Inc.
2+
13
import React from 'react';
24
import Confirmation from './index';
35
import App from '../App'
@@ -8,7 +10,7 @@ describe('Confirmation Component', () => {
810
beforeAll(() => {
911
children = (
1012
<div data-testid="wrapperNode">
11-
<div data-testid="childNode"></div>
13+
<div data-testid="childNode"></div>
1214
</div>
1315
);
1416
confirmMock = jest.fn().mockImplementation(() => {});
@@ -88,27 +90,27 @@ describe('Confirmation Component', () => {
8890
'Test to check if confirmation component disappears when %s is clicked',
8991
(input) => {
9092

91-
// Hide the tutorial and make the overlay visible.
93+
// Hide the tutorial and make the overlay visible.
9294
initialState.tutorialHidden = true;
9395
initialState.overlayVisibility = true;
9496

9597
const { debug, getByTestId, container } = render(<App />, {
9698
initialState: initialState,
97-
});
98-
99+
});
100+
99101
let startMatlabButton = getByTestId('startMatlabBtn');
100102
fireEvent.click(startMatlabButton);
101103

102104
// Upon clicking on start/restart MATLAB, should display the confirmation component.
103-
expect(container.querySelector('#confirmation')).toBeInTheDocument();
105+
expect(container.querySelector('#confirmation')).toBeInTheDocument();
104106

105107
const btn = getByTestId(input);
106108
fireEvent.click(btn);
107109

108110
// Upon clicking the input button, should return to rendering the Information Component
109111
// and close the confirmation component
110-
expect(container.querySelector('#confirmation')).not.toBeInTheDocument();
111-
}
112+
expect(container.querySelector('#confirmation')).not.toBeInTheDocument();
113+
}
112114
);
113115

114116
});

gui/src/components/Confirmation/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 The MathWorks, Inc.
1+
// Copyright 2020-2021 The MathWorks, Inc.
22

33
import React from 'react';
44
import PropTypes from 'prop-types';

gui/src/components/Controls/Controls.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2021 The MathWorks, Inc.
2+
13
import React from 'react';
24
import Controls from './index';
35
import App from '../App'
@@ -94,13 +96,13 @@ describe('Controls Component', () => {
9496

9597
it('should restart matlab upon clicking the Start/Restart Matlab button', () => {
9698

97-
//Hide the tutorial and make the overlay visible.
99+
//Hide the tutorial and make the overlay visible.
98100
initialState.tutorialHidden = true;
99101
initialState.overlayVisibility = true;
100102

101103
const { getByTestId, container } = render(<App />, {
102104
initialState: initialState,
103-
});
105+
});
104106

105107
const startMatlabButton = getByTestId('startMatlabBtn');
106108
fireEvent.click(startMatlabButton);
@@ -110,8 +112,8 @@ describe('Controls Component', () => {
110112
const confirmButton = getByTestId('confirmButton');
111113
fireEvent.click(confirmButton);
112114

113-
let tableData = container.querySelector('.details');
114-
expect(tableData.innerHTML).toMatch('Running');
115+
let tableData = container.querySelector('.details');
116+
expect(tableData.innerHTML).toMatch('Running');
115117
});
116118

117119
});

gui/src/components/Controls/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 The MathWorks, Inc.
1+
// Copyright 2020-2021 The MathWorks, Inc.
22

33
import React, { useMemo } from 'react';
44
import PropTypes from 'prop-types';

gui/src/components/Error/Error.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2021 The MathWorks, Inc.
2+
13
import React from 'react';
24
import Error from './index';
35
import { render } from '../../test/utils/react-test';

gui/src/components/Help/Help.spec.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2021 The MathWorks, Inc.
2+
13
import React from 'react';
24
import App from '../App'
35
import Help from './index';
@@ -50,19 +52,19 @@ describe('Help Component', () => {
5052

5153
expect(closeHandler).toHaveBeenCalledTimes(1);
5254
});
53-
55+
5456

5557
it('should close the Help Modal and display Information component when Back button is clicked', () => {
56-
57-
// Hide the tutorial and make the overlay visible.
58+
59+
// Hide the tutorial and make the overlay visible.
5860
initialState.tutorialHidden = true;
5961
initialState.overlayVisibility = true;
60-
62+
6163
//Rendering the App component with the above changes to the initial
6264
// state should render the Information Component.
6365
const { getByTestId, container } = render(<App />, {
6466
initialState: initialState,
65-
});
67+
});
6668

6769

6870
// Grab and click on the Help Button
@@ -73,7 +75,7 @@ describe('Help Component', () => {
7375

7476
// Check if Help dialog is rendered.
7577
expect(helpComponent).toBeInTheDocument();
76-
78+
7779
// Grab and click on the Back button in the help Component.
7880
const backButton = getByTestId('backBtn');
7981
fireEvent.click(backButton);

gui/src/components/Help/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 The MathWorks, Inc.
1+
// Copyright 2020-2021 The MathWorks, Inc.
22

33
import React from 'react';
44
import { useSelector } from 'react-redux';

gui/src/components/Information/Information.spec.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2021 The MathWorks, Inc.
2+
13
import React from 'react';
24
import Information from './index';
35
import App from '../App';
@@ -8,7 +10,7 @@ describe('Information Component', () => {
810
beforeEach(() => {
911
children = (
1012
<div data-testid="child">
11-
Child1
13+
Child1
1214
</div>
1315
);
1416
closeHandler = jest.fn().mockImplementation(() => {});
@@ -61,7 +63,7 @@ describe('Information Component', () => {
6163
<Information closeHandler={closeHandler} children={children} />
6264
);
6365

64-
expect(getByTestId('child')).toBeInTheDocument();
66+
expect(getByTestId('child')).toBeInTheDocument();
6567
});
6668

6769
it('should render Online Licensing info with licensing type MHLM', () => {
@@ -122,21 +124,21 @@ describe('Information Component', () => {
122124

123125
// const closeBtn = container.getElementsByClassName('close').item(0);
124126

125-
// fireEvent.click(closeBtn);
127+
// fireEvent.click(closeBtn);
126128
// });
127129

128130

129131
it('should close the Information Component and display the overlayTrigger when close button is clicked', () => {
130-
131-
// Hide the tutorial and make the overlay visible.
132+
133+
// Hide the tutorial and make the overlay visible.
132134
initialState.tutorialHidden = true;
133135
initialState.overlayVisibility = true;
134-
136+
135137
//Rendering the App component with the above changes to the initial
136138
// state should render the Information Component.
137139
const { getByTestId, debug, container } = render(<App />, {
138140
initialState: initialState,
139-
});
141+
});
140142

141143
const informationComponent = container.querySelector('#information');
142144

0 commit comments

Comments
 (0)