Skip to content

Commit 2364fed

Browse files
committed
Bump deps
1 parent 81f1124 commit 2364fed

File tree

5 files changed

+2779
-3326
lines changed

5 files changed

+2779
-3326
lines changed

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"@testing-library/react": "12.1.5",
5656
"@testing-library/user-event": "^14.4.3",
5757
"@types/jest": "^29.2.2",
58-
"@types/react": "^17.0.3",
59-
"@types/react-dom": "^17.0.2",
58+
"@types/react": "^16.14.43",
59+
"@types/react-dom": "^16.9.19",
6060
"auto-changelog": "^2.4.0",
6161
"husky": "^4.2.5",
6262
"jest": "^29.3.0",
@@ -67,11 +67,15 @@
6767
"ts-jest": "^29.0.3",
6868
"tsdx": "^0.14.1",
6969
"tslib": "^2.4.1",
70-
"typescript": "^4.8.4"
70+
"typescript": "^5.1.6"
7171
},
7272
"peerDependencies": {
7373
"react": ">=16 || >=17"
7474
},
75+
"resolutions": {
76+
"@types/react": "17",
77+
"@types/react-dom": "17"
78+
},
7579
"husky": {
7680
"hooks": {
7781
"pre-commit": "tsdx lint"

src/FormsyDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class FormsyDropdown extends Component<IFormsyDropdownProps> {
7575
};
7676

7777
handleBlur = (
78-
e: React.KeyboardEvent<HTMLElement>,
78+
e: React.FocusEvent<HTMLElement>,
7979
data: StrictDropdownProps
8080
) => {
8181
const { onBlur } = this.props;

test/Form.spec.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ describe('<Form/>', () => {
162162
// eslint-disable-line
163163
return (
164164
<Form
165-
onValidSubmit={onValidSubmit}
166-
onInvalidSubmit={onInvalidSubmit}
167-
onSubmit={onSubmit}
165+
onValidSubmit={(model) => onValidSubmit(model)}
166+
onInvalidSubmit={(model) => onInvalidSubmit(model)}
167+
onSubmit={(model) => onSubmit(model)}
168168
onValid={() => (isValid = true)}
169169
onInvalid={() => (isValid = false)}
170170
>
@@ -191,11 +191,7 @@ describe('<Form/>', () => {
191191
};
192192

193193
const validateSubmitCall = (formData: any) => {
194-
expect(onSubmit).toHaveBeenCalledWith(
195-
formData,
196-
expect.any(Function),
197-
expect.any(Function)
198-
);
194+
expect(onSubmit).toHaveBeenCalledWith(formData);
199195
};
200196

201197
beforeEach(() => {

test/FormsyCheckbox.spec.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ describe('<Checkbox/>', () => {
3131

3232
beforeEach(() => {
3333
onSubmitSpy = jest.fn();
34-
wrapper = render(<TestForm onSubmit={onSubmitSpy} />);
34+
wrapper = render(
35+
<TestForm onSubmit={(model: any) => onSubmitSpy(model)} />
36+
);
3537
checkbox = wrapper.getByRole('checkbox');
3638
});
3739

@@ -59,26 +61,21 @@ describe('<Checkbox/>', () => {
5961
it('should set a boolean value on checkbox without value / defaultChecked', () => {
6062
submitForm();
6163

62-
expect(onSubmitSpy).toHaveBeenCalledWith(
63-
{ testInput: false },
64-
expect.any(Function),
65-
expect.any(Function)
66-
);
64+
expect(onSubmitSpy).toHaveBeenCalledWith({ testInput: false });
6765
});
6866

6967
it('should use defaultChecked as initial value', () => {
7068
const spy = jest.fn();
7169
const defaultChecked = true;
7270
wrapper = render(
73-
<TestForm defaultChecked={defaultChecked} onSubmit={spy} />
71+
<TestForm
72+
defaultChecked={defaultChecked}
73+
onSubmit={(model: any) => spy(model)}
74+
/>
7475
);
7576
submitForm();
7677

77-
expect(spy).toHaveBeenCalledWith(
78-
{ testInput: defaultChecked },
79-
expect.any(Function),
80-
expect.any(Function)
81-
);
78+
expect(spy).toHaveBeenCalledWith({ testInput: defaultChecked });
8279
});
8380

8481
describe('When value is invalid', () => {

0 commit comments

Comments
 (0)