Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit 5de81b0

Browse files
committed
fix: tests + TypeScript types
1 parent 26d6529 commit 5de81b0

File tree

161 files changed

+1027
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1027
-464
lines changed

dist/.gitkeep

Whitespace-only changes.

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"jest": {
102102
"globals": {
103103
"ts-jest": {
104-
"useBabelrc": true
104+
"babelConfig": true
105105
}
106106
},
107107
"modulePathIgnorePatterns": [
@@ -120,18 +120,19 @@
120120
"^.+\\.tsx?$": "ts-jest"
121121
},
122122
"moduleFileExtensions": [
123-
"ts",
124-
"tsx",
125123
"js",
126-
"jsx",
127124
"json",
128-
"node"
129-
]
125+
"jsx",
126+
"node",
127+
"ts",
128+
"tsx"
129+
],
130+
"preset": "ts-jest/presets/js-with-babel",
131+
"testMatch": null
130132
},
131133
"dependencies": {
132134
"@manaflair/redux-batch": "^1.0.0",
133135
"@reduxjs/toolkit": "^1.2.3",
134-
"@types/lodash": "^4.14.149",
135136
"electron-localshortcut": "^3.2.1",
136137
"electron-log": "^2.2.9",
137138
"electron-settings": "^3.1.3",
@@ -176,9 +177,12 @@
176177
"@material-ui/lab": "^3.0.0-alpha.30",
177178
"@rollup/plugin-typescript": "^2.1.0",
178179
"@types/jest": "^24.0.25",
180+
"@types/lodash": "^4.14.149",
179181
"@types/moxios": "^0.4.9",
180182
"@types/node": "^13.1.4",
181183
"@types/react-i18next": "^8.1.0",
184+
"@types/react-router": "^5.1.4",
185+
"@types/react-router-dom": "^5.1.3",
182186
"animate.css": "^3.7.2",
183187
"awaiting": "^3.0.0",
184188
"axios": "0.18.1",
@@ -236,8 +240,8 @@
236240
"react-map-gl": "^3.3.5",
237241
"react-number-format": "^4.0.7",
238242
"react-redux": "^5.0.7",
239-
"react-router": "^4.3.1",
240-
"react-router-dom": "^4.3.1",
243+
"react-router": "^5.1.2",
244+
"react-router-dom": "^5.1.2",
241245
"react-spring": "^3.1.0",
242246
"react-sticky-box": "^0.6.1",
243247
"react-test-renderer": "^16.3.1",
@@ -257,7 +261,7 @@
257261
"ts-jest": "^24.3.0",
258262
"ts-loader": "^6.2.1",
259263
"typeface-roboto": "^0.0.54",
260-
"typescript": "^3.0.1",
264+
"typescript": "^3.7.5",
261265
"uglifyjs-webpack-plugin": "^1.3.0",
262266
"universal-analytics": "^0.4.15",
263267
"vcf": "^2.0.1",

src/app.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import "~helpers/context_menu";
22
import "~helpers/external_links";
33
import BunqDesktopClient from "~components/BunqDesktopClient";
4+
import { CryptoWorkerQueue } from "~functions/Crypto/CryptoWorkerWrapper";
45

5-
export type AppWindow = Window & { BunqDesktopClient?: BunqDesktopClient; t: Function; BUNQDESKTOP_LANGUAGE_SETTING: string };
6+
export type AppWindow = Window & {
7+
BunqDesktopClient?: BunqDesktopClient;
8+
t: Function;
9+
BUNQDESKTOP_LANGUAGE_SETTING: string;
10+
cryptoWorkerQueue: CryptoWorkerQueue;
11+
};

src/components/AccountCard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ const styles = {
4444
};
4545

4646
interface IState {
47+
[key: string]: any;
4748
}
4849

4950
interface IProps {
51+
[key: string]: any;
5052
}
5153

5254
class AccountCard extends React.Component<ReturnType<typeof mapStateToProps> & ReturnType<typeof mapDispatchToProps> & IProps> {

src/components/AccountList/AccountAvatarCircularProgress.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const styles = {
1414
};
1515

1616
interface IState {
17+
[key: string]: any;
1718
}
1819

1920
interface IProps {
@@ -77,6 +78,7 @@ const AccountAvatarCircularProgress = ({ account, theme, selected = false, style
7778

7879
const mapStateToProps = (state: ReduxState) => {
7980
return {
81+
// @ts-ignore
8082
theme: state.options.theme,
8183
};
8284
};

src/components/AccountList/AccountList.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ interface IState {
4949
totalBalance: number;
5050
fetchedAccounts: any;
5151
accountTotalSelectionMode: any;
52+
[key: string]: any;
5253
}
5354

5455
interface IProps {
5556
t: AppWindow["t"];
5657
BunqJSClient: BunqJSClient;
58+
[key: string]: any;
5759
}
5860

5961
class AccountList extends React.Component<ReturnType<typeof mapStateToProps> & ReturnType<typeof mapDispatchToProps> & IProps> {
@@ -313,10 +315,13 @@ const mapStateToProps = (state: ReduxState) => {
313315
return {
314316
user: state.user.user,
315317
userType: state.user.user_type,
318+
319+
// @ts-ignore
316320
limitedPermissions: state.user.limited_permissions,
317321

318322
applicationLastAutoUpdate: state.application.last_auto_update,
319323

324+
// @ts-ignore
320325
hideBalance: state.options.hide_balance,
321326

322327
registrationIsLoading: state.registration.loading,

src/components/AccountList/AccountListItem.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import BunqJSClient from "@bunq-community/bunq-js-client";
21
import React, { CSSProperties } from "react";
32
import { translate } from "react-i18next";
43
import { connect } from "react-redux";
54
import Avatar from "@material-ui/core/Avatar";
6-
import IconButton from "@material-ui/core/IconButton";
5+
import OriginalIconButton from "@material-ui/core/IconButton";
76
import ListItem from "@material-ui/core/ListItem";
87
import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction";
98
import ListItemText from "@material-ui/core/ListItemText";
@@ -24,6 +23,8 @@ import AccountAvatarCircularProgress from "./AccountAvatarCircularProgress";
2423

2524
import { actions as accountsActions } from "~store/accounts";
2625

26+
const IconButton: any = OriginalIconButton;
27+
2728
const styles = {
2829
bigAvatar: {
2930
width: 60,
@@ -44,10 +45,11 @@ const styles = {
4445
};
4546

4647
interface IState {
48+
[key: string]: any;
4749
}
4850

4951
interface IProps {
50-
BunqJSClient: BunqJSClient;
52+
[key: string]: any;
5153
}
5254

5355
class AccountListItem extends React.Component<ReturnType<typeof mapStateToProps> & ReturnType<typeof mapDispatchToProps> & IProps> {
@@ -181,16 +183,18 @@ class AccountListItem extends React.Component<ReturnType<typeof mapStateToProps>
181183
const mapStateToProps = (state: ReduxState) => {
182184
return {
183185
user: state.user.user,
186+
// @ts-ignore
184187
theme: state.options.theme,
185188
paymentsLoading: state.payments.loading,
189+
// @ts-ignore
186190
hideBalance: state.options.hide_balance,
187191

188192
selectedAccountIds: state.accountIdFilter.selectedAccountIds,
189193
toggleAccountIds: state.accountIdFilter.toggle,
190194
};
191195
};
192196

193-
const mapDispatchToProps = (dispatch: AppDispatch, ownProps: IProps) => {
197+
const mapDispatchToProps = (dispatch: AppDispatch) => {
194198
return {
195199
selectAccount: accountId => dispatch(accountsActions.selectAccount(accountId)),
196200

src/components/AccountList/AccountListItemChip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default props => {
1414
onDelete
1515
} = props;
1616

17-
const chipProps = {
17+
const chipProps: any = {
1818
style: style,
1919
label: account.description
2020
};

src/components/AccountList/AddAccount.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
import React from "react";
22
import { connect } from "react-redux";
3-
import ListItem from "@material-ui/core/ListItem";
3+
import OriginalListItem from "@material-ui/core/ListItem";
44
import ListItemText from "@material-ui/core/ListItemText";
55
import Avatar from "@material-ui/core/Avatar";
66
import AddBoxIcon from "@material-ui/icons/AddBox";
77

88
import NavLink from "~components/Routing/NavLink";
99
import { translate } from "react-i18next";
1010

11+
const ListItem: any = OriginalListItem;
12+
1113
const styles = {
1214
bigAvatar: {
1315
width: 60,
1416
height: 60
1517
}
1618
};
1719

18-
class AddAccount extends React.Component {
20+
interface IState {
21+
[key: string]: any;
22+
}
23+
24+
interface IProps {
25+
[key: string]: any;
26+
}
27+
28+
class AddAccount extends React.Component<IProps> {
29+
state: IState;
30+
1931
constructor(props, context) {
2032
super(props, context);
2133
this.state = {};

src/components/App.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import BunqJSClient from "@bunq-community/bunq-js-client";
21
import React from "react";
32
import { Provider } from "react-redux";
43
import { HashRouter } from "react-router-dom";
@@ -14,8 +13,7 @@ import store from "~store/index";
1413
import "./i18n";
1514

1615
export interface IProps {
17-
analytics: boolean;
18-
BunqJSClient: BunqJSClient;
16+
[key: string]: any;
1917
}
2018

2119
export default class App extends React.Component<IProps> {
@@ -30,10 +28,7 @@ export default class App extends React.Component<IProps> {
3028
<MuiPickersUtilsProvider utils={DateFnsUtils}>
3129
<Provider store={store}>
3230
<HashRouter>
33-
<Layout
34-
routesComponent={Routes}
35-
analytics={this.props.analytics}
36-
/>
31+
<Layout routesComponent={Routes} />
3732
</HashRouter>
3833
</Provider>
3934
</MuiPickersUtilsProvider>

0 commit comments

Comments
 (0)