Skip to content

Commit

Permalink
build: update dep, change proptypes object to shape
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Nov 17, 2020
1 parent 47239f3 commit ce58df1
Show file tree
Hide file tree
Showing 15 changed files with 2,923 additions and 2,679 deletions.
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"dependencies": {
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@sentry/browser": "5.24.2",
"@sentry/electron": "2.0.1",
"@sentry/browser": "5.27.3",
"@sentry/electron": "2.0.3",
"about-window": "1.13.4",
"archiver": "5.0.2",
"bson-objectid": "1.3.1",
Expand All @@ -85,41 +85,41 @@
"download": "8.0.0",
"electron-devtools-installer": "3.1.1",
"electron-is-dev": "1.2.0",
"electron-log": "4.2.4",
"electron-log": "4.3.0",
"electron-publisher-s3": "20.17.2",
"electron-updater": "4.3.5",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.5",
"extract-zip": "2.0.1",
"fs-extra": "9.0.1",
"history": "5.0.0",
"i18next": "19.7.0",
"i18next": "19.8.3",
"immutable": "4.0.0-rc.12",
"is-online": "8.4.0",
"is-online": "9.0.0",
"katex": "0.12.0",
"lodash": "4.17.20",
"lowdb": "1.0.0",
"md5": "2.3.0",
"mime-types": "2.1.27",
"mkdirp": "1.0.4",
"mocha": "8.1.3",
"mocha": "8.2.1",
"node-machine-id": "1.1.12",
"prop-types": "15.7.2",
"qs": "6.9.4",
"re-resizable": "6.6.1",
"react": "16.13.1",
"re-resizable": "6.9.0",
"react": "17.0.1",
"react-countup": "4.3.3",
"react-detect-offline": "2.4.0",
"react-dev-utils": "10.2.1",
"react-dev-utils": "11.0.0",
"react-diff-viewer": "3.1.1",
"react-dom": "16.13.1",
"react-dom": "17.0.1",
"react-i18next": "11.7.3",
"react-immutable-proptypes": "2.2.0",
"react-joyride": "2.2.1",
"react-json-view": "1.19.1",
"react-loading": "2.0.3",
"react-quill": "1.3.5",
"react-redux": "7.2.1",
"react-redux": "7.2.2",
"react-redux-toastr": "7.6.5",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
Expand All @@ -135,28 +135,28 @@
"universal-analytics": "0.4.23"
},
"devDependencies": {
"@babel/cli": "7.11.6",
"@babel/core": "7.11.6",
"@babel/plugin-transform-runtime": "7.11.5",
"@babel/preset-env": "7.11.5",
"@babel/register": "7.11.5",
"@babel/cli": "7.12.1",
"@babel/core": "7.12.3",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/register": "7.12.1",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"codacy-coverage": "3.4.0",
"concurrently": "5.3.0",
"cross-env": "7.0.2",
"electron": "10.1.3",
"electron-builder": "22.8.1",
"electron": "10.1.5",
"electron-builder": "22.9.1",
"env-cmd": "10.1.0",
"enzyme-to-json": "3.6.1",
"eslint-config-airbnb": "18.2.0",
"eslint-config-prettier": "6.12.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-prettier": "6.15.0",
"eslint-plugin-mocha": "8.0.0",
"husky": "4.3.0",
"npm-run-all": "4.1.5",
"prettier": "2.1.2",
"pretty-quick": "3.0.2",
"react-scripts": "3.4.3",
"pretty-quick": "3.1.0",
"react-scripts": "4.0.0",
"redux-mock-store": "1.5.4",
"spectron": "12.0.0",
"standard-version": "9.0.0",
Expand Down
8 changes: 7 additions & 1 deletion src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { App } from './App';
import { DEFAULT_USER_MODE } from './config/constants';

window.ipcRenderer = { once: jest.fn(), send: jest.fn() };

Expand All @@ -18,7 +19,12 @@ describe('<App />', () => {
dispatchGetGeolocationEnabled: jest.fn(),
dispatchIsAuthenticated: jest.fn(),
geolocationEnabled: false,
classes: {},
classes: {
toastrIcon: '',
fullScreen: '',
},
userMode: DEFAULT_USER_MODE,
connexionStatus: true,
};

// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
20 changes: 3 additions & 17 deletions src/__snapshots__/App.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ exports[`<App /> renders correctly 1`] = `
},
"primary": Object {
"contrastText": "#fff",
"dark": "#737373",
"light": "#737373",
"main": "#737373",
"dark": "#5050d2",
"light": "#5050d2",
"main": "#5050d2",
},
"secondary": Object {
"contrastText": "rgba(0, 0, 0, 0.87)",
Expand Down Expand Up @@ -316,7 +316,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -329,7 +328,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -342,7 +340,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -355,7 +352,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -368,7 +364,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -381,7 +376,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -399,7 +393,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -412,7 +405,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -425,7 +417,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -438,7 +429,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -451,7 +441,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -464,7 +453,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -477,7 +465,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand All @@ -490,7 +477,6 @@ exports[`<App /> renders correctly 1`] = `
"$$typeof": Symbol(react.memo),
"WrappedComponent": [Function],
"compare": null,
"displayName": "Connect(ComposedComponent)",
"type": [Function],
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { USER_MODES } from '../config/constants';

const createSettingsProps = () => {
return {
t: text => text,
t: (text) => text,
classes: {
appBar: '',
root: '',
Expand All @@ -22,6 +22,7 @@ const createSettingsProps = () => {
content: '',
contentShift: '',
settings: '',
divider: '',
},
theme: {
direction: 'ltr',
Expand Down
2 changes: 1 addition & 1 deletion src/components/__snapshots__/Settings.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`<Settings /> renders correctly 1`] = `
<WithStyles(ForwardRef(Divider))
classes={
Object {
"root": undefined,
"root": "",
}
}
variant="middle"
Expand Down
21 changes: 16 additions & 5 deletions src/components/common/MainMenu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,27 @@ import {
DASHBOARD_PATH,
SAVED_SPACES_PATH,
} from '../../config/paths';
import { DEFAULT_USER_MODE } from '../../config/constants';

const MENUITEM_OFFLINE_NUMBER = 2;
const MENUITEM_OFFLINE_ONLINE_COUNT = 11;

const createMainMenuProps = (developerMode, path, authenticated = true) => {
const createMainMenuProps = (
developerMode,
path,
authenticated = true,
userMode = DEFAULT_USER_MODE
) => {
return {
t: text => text,
t: (text) => text,
developerMode,
history: { replace: jest.fn() },
match: { path },
authenticated,
userMode,
location: {
pathname: 'somepath',
},
};
};

Expand Down Expand Up @@ -93,8 +103,9 @@ describe('<MainMenu />', () => {
);
});

it(`renders ${MENUITEM_OFFLINE_ONLINE_COUNT +
1} <MenuItem /> components`, () => {
it(`renders ${
MENUITEM_OFFLINE_ONLINE_COUNT + 1
} <MenuItem /> components`, () => {
expect(wrapper.find(MenuItem)).toHaveLength(
MENUITEM_OFFLINE_ONLINE_COUNT + 1
);
Expand All @@ -118,7 +129,7 @@ describe('<MainMenu />', () => {
const selectedMenuItem = wrapper.find({ selected: true });
expect(selectedMenuItem.length).toBeLessThanOrEqual(2);
expect(
selectedMenuItem.map(menuItem =>
selectedMenuItem.map((menuItem) =>
menuItem.find(ListItemText).prop('primary')
)
).toEqual(Array(selectedMenuItem.length).fill(text));
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Tour extends Component {
dispatchResetTour: PropTypes.func.isRequired,
dispatchInitializeTour: PropTypes.func.isRequired,
tourKey: PropTypes.string.isRequired,
currentTour: PropTypes.oneOf(tours).isRequired,
currentTour: PropTypes.oneOf(Object.values(tours)).isRequired,
run: PropTypes.bool.isRequired,
continuous: PropTypes.bool.isRequired,
stepIndex: PropTypes.number.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`<DeveloperSwitch /> <DeveloperSwitch /> renders renders correctly 1`] =
>
<WithStyles(ForwardRef(FormControlLabel))
control={
<ForwardRef(WithStyles)
<WithStyles(ForwardRef(Switch))
checked={false}
color="primary"
onChange={[Function]}
Expand All @@ -26,7 +26,7 @@ exports[`<DeveloperSwitch /> <DeveloperSwitch /> renders renders correctly 2`] =
>
<WithStyles(ForwardRef(FormControlLabel))
control={
<ForwardRef(WithStyles)
<WithStyles(ForwardRef(Switch))
checked={true}
color="primary"
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports[`<GeolocationControl /> <GeolocationControl /> as switch renders correct
>
<WithStyles(ForwardRef(FormControlLabel))
control={
<ForwardRef(WithStyles)
<WithStyles(ForwardRef(Switch))
checked={false}
color="primary"
onChange={[Function]}
Expand All @@ -56,7 +56,7 @@ exports[`<GeolocationControl /> <GeolocationControl /> as switch renders correct
>
<WithStyles(ForwardRef(FormControlLabel))
control={
<ForwardRef(WithStyles)
<WithStyles(ForwardRef(Switch))
checked={true}
color="primary"
onChange={[Function]}
Expand Down
8 changes: 4 additions & 4 deletions src/components/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export class Dashboard extends Component {
changeLanguage: PropTypes.func.isRequired,
}).isRequired,
database: PropTypes.shape({
user: PropTypes.object,
spaces: PropTypes.arrayOf(PropTypes.object),
users: PropTypes.arrayOf(PropTypes.object),
actions: PropTypes.arrayOf(PropTypes.object),
user: PropTypes.shape({}),
spaces: PropTypes.arrayOf(PropTypes.shape({})),
users: PropTypes.arrayOf(PropTypes.shape({})),
actions: PropTypes.arrayOf(PropTypes.shape({})),
}),
dispatchGetDatabase: PropTypes.func.isRequired,
userMode: PropTypes.oneOf(Object.values(USER_MODES)).isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/Dashboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const sampleDatabase = {
};

const createDashboardProps = ({
userId,
userId = 'userId',
userMode = DEFAULT_USER_MODE,
users,
actions,
Expand Down
Loading

0 comments on commit ce58df1

Please sign in to comment.