From 85b099e2dc03028fb1eb9b2c7ab4f570f8bd6507 Mon Sep 17 00:00:00 2001
From: Love Lagerkvist <30436214+motform@users.noreply.github.com>
Date: Tue, 20 Feb 2024 14:58:57 +0100
Subject: [PATCH] chore: Point release workflow to `master` branch (#97)
---
.github/workflows/release-django-bananas.yml | 4 +-
package-lock.json | 169 ++++++++++++-------
package.json | 3 +-
src/forms/Form.js | 4 +-
src/pages/LoginPage.js | 6 +-
tests/app.test.js | 53 +++---
tests/forms/Form.test.js | 12 +-
7 files changed, 150 insertions(+), 101 deletions(-)
diff --git a/.github/workflows/release-django-bananas.yml b/.github/workflows/release-django-bananas.yml
index 8fb6670..1f1baf5 100644
--- a/.github/workflows/release-django-bananas.yml
+++ b/.github/workflows/release-django-bananas.yml
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- - main
+ - master
paths:
- ".github/workflows/release-djedi-json.yml"
- "package.json"
@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
- node-version: "16.x"
+ node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci --legacy-peer-deps
diff --git a/package-lock.json b/package-lock.json
index 13a34e2..e941996 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,9 +9,10 @@
"version": "4.1.0",
"license": "MIT",
"dependencies": {
- "@date-io/date-fns": "^1.3.13",
+ "@date-io/date-fns": "^2.17.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
+ "@mui/x-date-pickers": "^6.19.4",
"classnames": "^2.5.1",
"date-fns": "^2.23.0",
"history": "^4.10.1",
@@ -2090,20 +2091,25 @@
"dev": true
},
"node_modules/@date-io/date-fns": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@date-io/date-fns/-/date-fns-1.3.13.tgz",
- "integrity": "sha512-yXxGzcRUPcogiMj58wVgFjc9qUYrCnnU9eLcyNbsQCmae4jPuZCDoIBR21j8ZURsM7GRtU62VOw5yNd4dDHunA==",
+ "version": "2.17.0",
+ "resolved": "https://registry.npmjs.org/@date-io/date-fns/-/date-fns-2.17.0.tgz",
+ "integrity": "sha512-L0hWZ/mTpy3Gx/xXJ5tq5CzHo0L7ry6KEO9/w/JWiFWFLZgiNVo3ex92gOl3zmzjHqY/3Ev+5sehAr8UnGLEng==",
"dependencies": {
- "@date-io/core": "^1.3.13"
+ "@date-io/core": "^2.17.0"
},
"peerDependencies": {
"date-fns": "^2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "date-fns": {
+ "optional": true
+ }
}
},
"node_modules/@date-io/date-fns/node_modules/@date-io/core": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@date-io/core/-/core-1.3.13.tgz",
- "integrity": "sha512-AlEKV7TxjeK+jxWVKcCFrfYAk8spX9aCyiToFIiLPtfQbsjmRGLIhb5VZgptQcJdHtLXo7+m0DuurwFgUToQuA=="
+ "version": "2.17.0",
+ "resolved": "https://registry.npmjs.org/@date-io/core/-/core-2.17.0.tgz",
+ "integrity": "sha512-+EQE8xZhRM/hsY0CDTVyayMDDY5ihc4MqXCrPxooKw19yAzUIC6uUqsZeaOFNL9YKTNxYKrJP5DFgE8o5xRCOw=="
},
"node_modules/@discoveryjs/json-ext": {
"version": "0.5.3",
@@ -2386,7 +2392,6 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz",
"integrity": "sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==",
- "dev": true,
"dependencies": {
"@floating-ui/utils": "^0.2.1"
}
@@ -2395,7 +2400,6 @@
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz",
"integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==",
- "dev": true,
"dependencies": {
"@floating-ui/core": "^1.0.0",
"@floating-ui/utils": "^0.2.0"
@@ -2405,7 +2409,6 @@
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz",
"integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==",
- "dev": true,
"dependencies": {
"@floating-ui/dom": "^1.6.1"
},
@@ -2417,8 +2420,7 @@
"node_modules/@floating-ui/utils": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz",
- "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==",
- "dev": true
+ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q=="
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.11.14",
@@ -4099,7 +4101,6 @@
"version": "5.0.0-beta.36",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.36.tgz",
"integrity": "sha512-6A8fYiXgjqTO6pgj31Hc8wm1M3rFYCxDRh09dBVk0L0W4cb2lnurRJa3cAyic6hHY+we1S58OdGYRbKmOsDpGQ==",
- "dev": true,
"dependencies": {
"@babel/runtime": "^7.23.9",
"@floating-ui/react-dom": "^2.0.8",
@@ -4393,7 +4394,6 @@
"version": "7.2.13",
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.13.tgz",
"integrity": "sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g==",
- "dev": true,
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0"
},
@@ -4407,7 +4407,6 @@
"version": "5.15.9",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.9.tgz",
"integrity": "sha512-yDYfr61bCYUz1QtwvpqYy/3687Z8/nS4zv7lv/ih/6ZFGMl1iolEvxRmR84v2lOYxlds+kq1IVYbXxDKh8Z9sg==",
- "dev": true,
"dependencies": {
"@babel/runtime": "^7.23.9",
"@types/prop-types": "^15.7.11",
@@ -4431,6 +4430,71 @@
}
}
},
+ "node_modules/@mui/x-date-pickers": {
+ "version": "6.19.4",
+ "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.19.4.tgz",
+ "integrity": "sha512-LekaacLGnoQNN5hD6iXeHFL4LbZPnr1BM57hnUKy5UgKDHqzHzZSdPGc2p7Ktv/Z2NDbpPaLEAgrLwISKIYcow==",
+ "dependencies": {
+ "@babel/runtime": "^7.23.2",
+ "@mui/base": "^5.0.0-beta.22",
+ "@mui/utils": "^5.14.16",
+ "@types/react-transition-group": "^4.4.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1",
+ "react-transition-group": "^4.4.5"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui"
+ },
+ "peerDependencies": {
+ "@emotion/react": "^11.9.0",
+ "@emotion/styled": "^11.8.1",
+ "@mui/material": "^5.8.6",
+ "@mui/system": "^5.8.0",
+ "date-fns": "^2.25.0 || ^3.2.0",
+ "date-fns-jalali": "^2.13.0-0",
+ "dayjs": "^1.10.7",
+ "luxon": "^3.0.2",
+ "moment": "^2.29.4",
+ "moment-hijri": "^2.1.2",
+ "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@emotion/react": {
+ "optional": true
+ },
+ "@emotion/styled": {
+ "optional": true
+ },
+ "date-fns": {
+ "optional": true
+ },
+ "date-fns-jalali": {
+ "optional": true
+ },
+ "dayjs": {
+ "optional": true
+ },
+ "luxon": {
+ "optional": true
+ },
+ "moment": {
+ "optional": true
+ },
+ "moment-hijri": {
+ "optional": true
+ },
+ "moment-jalaali": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@nicolo-ribaudo/chokidar-2": {
"version": "2.1.8-no-fsevents.3",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz",
@@ -4499,7 +4563,6 @@
"version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
- "dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
@@ -5008,8 +5071,7 @@
"node_modules/@types/prop-types": {
"version": "15.7.11",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
- "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==",
- "dev": true
+ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng=="
},
"node_modules/@types/qs": {
"version": "6.9.11",
@@ -5027,7 +5089,6 @@
"version": "18.2.55",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz",
"integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==",
- "dev": true,
"dependencies": {
"@types/prop-types": "*",
"@types/scheduler": "*",
@@ -5047,7 +5108,6 @@
"version": "4.4.10",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz",
"integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==",
- "dev": true,
"dependencies": {
"@types/react": "*"
}
@@ -5061,8 +5121,7 @@
"node_modules/@types/scheduler": {
"version": "0.16.8",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
- "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==",
- "dev": true
+ "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A=="
},
"node_modules/@types/semver": {
"version": "7.5.7",
@@ -6882,7 +6941,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz",
"integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==",
- "dev": true,
"engines": {
"node": ">=6"
}
@@ -7642,7 +7700,6 @@
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",
"integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==",
- "dev": true,
"dependencies": {
"@babel/runtime": "^7.8.7",
"csstype": "^3.0.2"
@@ -15980,14 +16037,12 @@
"node_modules/react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
- "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==",
- "dev": true
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
},
"node_modules/react-transition-group": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
"integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",
- "dev": true,
"dependencies": {
"@babel/runtime": "^7.5.5",
"dom-helpers": "^5.0.1",
@@ -20059,17 +20114,17 @@
"dev": true
},
"@date-io/date-fns": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@date-io/date-fns/-/date-fns-1.3.13.tgz",
- "integrity": "sha512-yXxGzcRUPcogiMj58wVgFjc9qUYrCnnU9eLcyNbsQCmae4jPuZCDoIBR21j8ZURsM7GRtU62VOw5yNd4dDHunA==",
+ "version": "2.17.0",
+ "resolved": "https://registry.npmjs.org/@date-io/date-fns/-/date-fns-2.17.0.tgz",
+ "integrity": "sha512-L0hWZ/mTpy3Gx/xXJ5tq5CzHo0L7ry6KEO9/w/JWiFWFLZgiNVo3ex92gOl3zmzjHqY/3Ev+5sehAr8UnGLEng==",
"requires": {
- "@date-io/core": "^1.3.13"
+ "@date-io/core": "^2.17.0"
},
"dependencies": {
"@date-io/core": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@date-io/core/-/core-1.3.13.tgz",
- "integrity": "sha512-AlEKV7TxjeK+jxWVKcCFrfYAk8spX9aCyiToFIiLPtfQbsjmRGLIhb5VZgptQcJdHtLXo7+m0DuurwFgUToQuA=="
+ "version": "2.17.0",
+ "resolved": "https://registry.npmjs.org/@date-io/core/-/core-2.17.0.tgz",
+ "integrity": "sha512-+EQE8xZhRM/hsY0CDTVyayMDDY5ihc4MqXCrPxooKw19yAzUIC6uUqsZeaOFNL9YKTNxYKrJP5DFgE8o5xRCOw=="
}
}
},
@@ -20290,7 +20345,6 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz",
"integrity": "sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==",
- "dev": true,
"requires": {
"@floating-ui/utils": "^0.2.1"
}
@@ -20299,7 +20353,6 @@
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz",
"integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==",
- "dev": true,
"requires": {
"@floating-ui/core": "^1.0.0",
"@floating-ui/utils": "^0.2.0"
@@ -20309,7 +20362,6 @@
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz",
"integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==",
- "dev": true,
"requires": {
"@floating-ui/dom": "^1.6.1"
}
@@ -20317,8 +20369,7 @@
"@floating-ui/utils": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz",
- "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==",
- "dev": true
+ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q=="
},
"@humanwhocodes/config-array": {
"version": "0.11.14",
@@ -21615,7 +21666,6 @@
"version": "5.0.0-beta.36",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.36.tgz",
"integrity": "sha512-6A8fYiXgjqTO6pgj31Hc8wm1M3rFYCxDRh09dBVk0L0W4cb2lnurRJa3cAyic6hHY+we1S58OdGYRbKmOsDpGQ==",
- "dev": true,
"requires": {
"@babel/runtime": "^7.23.9",
"@floating-ui/react-dom": "^2.0.8",
@@ -21743,14 +21793,12 @@
"@mui/types": {
"version": "7.2.13",
"resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.13.tgz",
- "integrity": "sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g==",
- "dev": true
+ "integrity": "sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g=="
},
"@mui/utils": {
"version": "5.15.9",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.9.tgz",
"integrity": "sha512-yDYfr61bCYUz1QtwvpqYy/3687Z8/nS4zv7lv/ih/6ZFGMl1iolEvxRmR84v2lOYxlds+kq1IVYbXxDKh8Z9sg==",
- "dev": true,
"requires": {
"@babel/runtime": "^7.23.9",
"@types/prop-types": "^15.7.11",
@@ -21758,6 +21806,20 @@
"react-is": "^18.2.0"
}
},
+ "@mui/x-date-pickers": {
+ "version": "6.19.4",
+ "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.19.4.tgz",
+ "integrity": "sha512-LekaacLGnoQNN5hD6iXeHFL4LbZPnr1BM57hnUKy5UgKDHqzHzZSdPGc2p7Ktv/Z2NDbpPaLEAgrLwISKIYcow==",
+ "requires": {
+ "@babel/runtime": "^7.23.2",
+ "@mui/base": "^5.0.0-beta.22",
+ "@mui/utils": "^5.14.16",
+ "@types/react-transition-group": "^4.4.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1",
+ "react-transition-group": "^4.4.5"
+ }
+ },
"@nicolo-ribaudo/chokidar-2": {
"version": "2.1.8-no-fsevents.3",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz",
@@ -21807,8 +21869,7 @@
"@popperjs/core": {
"version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
- "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
- "dev": true
+ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="
},
"@sinclair/typebox": {
"version": "0.27.8",
@@ -22231,8 +22292,7 @@
"@types/prop-types": {
"version": "15.7.11",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
- "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==",
- "dev": true
+ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng=="
},
"@types/qs": {
"version": "6.9.11",
@@ -22250,7 +22310,6 @@
"version": "18.2.55",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz",
"integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==",
- "dev": true,
"requires": {
"@types/prop-types": "*",
"@types/scheduler": "*",
@@ -22270,7 +22329,6 @@
"version": "4.4.10",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz",
"integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==",
- "dev": true,
"requires": {
"@types/react": "*"
}
@@ -22284,8 +22342,7 @@
"@types/scheduler": {
"version": "0.16.8",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
- "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==",
- "dev": true
+ "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A=="
},
"@types/semver": {
"version": "7.5.7",
@@ -23661,8 +23718,7 @@
"clsx": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz",
- "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==",
- "dev": true
+ "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg=="
},
"co": {
"version": "4.6.0",
@@ -24233,7 +24289,6 @@
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",
"integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==",
- "dev": true,
"requires": {
"@babel/runtime": "^7.8.7",
"csstype": "^3.0.2"
@@ -30463,14 +30518,12 @@
"react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
- "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==",
- "dev": true
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
},
"react-transition-group": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
"integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",
- "dev": true,
"requires": {
"@babel/runtime": "^7.5.5",
"dom-helpers": "^5.0.1",
diff --git a/package.json b/package.json
index 417e3df..66b0b30 100644
--- a/package.json
+++ b/package.json
@@ -21,9 +21,10 @@
"test": "npm run eslint && npm run coverage && npm run build"
},
"dependencies": {
- "@date-io/date-fns": "^1.3.13",
+ "@date-io/date-fns": "^2.17.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
+ "@mui/x-date-pickers": "^6.19.4",
"classnames": "^2.5.1",
"date-fns": "^2.23.0",
"history": "^4.10.1",
diff --git a/src/forms/Form.js b/src/forms/Form.js
index c8b651c..ebd1a96 100644
--- a/src/forms/Form.js
+++ b/src/forms/Form.js
@@ -1,5 +1,5 @@
-import AdapterDateFns from "@mui/lab/AdapterDateFns";
-import LocalizationProvider from "@mui/lab/LocalizationProvider";
+import { LocalizationProvider } from "@mui/x-date-pickers/";
+import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
import { FORM_ERROR } from "final-form";
import arrayMutators from "final-form-arrays";
import PropTypes from "prop-types";
diff --git a/src/pages/LoginPage.js b/src/pages/LoginPage.js
index c69f697..a266348 100644
--- a/src/pages/LoginPage.js
+++ b/src/pages/LoginPage.js
@@ -24,11 +24,7 @@ const DialogTitle = withStyles(theme => ({
},
}))(props => {
const { children, classes } = props;
- return (
-
- {children}
-
- );
+ return {children};
});
const pageStyles = theme => ({
diff --git a/tests/app.test.js b/tests/app.test.js
index adc45c5..53f36b7 100644
--- a/tests/app.test.js
+++ b/tests/app.test.js
@@ -1,6 +1,12 @@
import "@testing-library/jest-dom";
-import { cleanup, fireEvent, render, waitFor } from "@testing-library/react";
+import {
+ cleanup,
+ fireEvent,
+ render,
+ waitFor,
+ screen,
+} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import fetchMock from "fetch-mock";
import Logger from "js-logger";
@@ -73,18 +79,17 @@ test("Can boot and login", async () => {
});
// Fill login form and
- const username = getByLabelText("Username", { selector: "input" });
- const password = getByLabelText("Password", { selector: "input" });
- userEvent.type(username, "admin");
- userEvent.type(password, "test");
+ const username = screen.getByLabelText("Username", { selector: "input" });
+ const password = screen.getByLabelText("Password", { selector: "input" });
+ await userEvent.type(username, "admin");
+ await userEvent.type(password, "test");
// Click login submit button
- const loginSubmitButton = getByLabelText("login");
- userEvent.click(loginSubmitButton);
+ const loginSubmitButton = screen.getByLabelText("login");
+ await userEvent.click(loginSubmitButton);
- // Wait for logged in username to be rendered, i.e. NavBar is rendered
- const profileMenuItem = () => getByText(user.full_name);
- await waitFor(profileMenuItem, { container });
+ // screen.getByText(user.full_name);
+ expect(await screen.findByText(user.full_name, {})).toBeVisible();
});
test("Can shutdown", async () => {
@@ -121,7 +126,7 @@ test("Can render dashboard and navigate using menu", async () => {
});
// Click Users menu item
- userEvent.click(usersMenuItem);
+ await userEvent.click(usersMenuItem);
// Wait for user list page to be rendered
await waitFor(() => getByText(`${userListRoute.title} (users)`), {
@@ -133,12 +138,12 @@ test("Can render dashboard and navigate using menu", async () => {
expect(user1Link).toBeTruthy();
// Click one of the users and expect page template not to implemented
- userEvent.click(user1Link);
+ await userEvent.click(user1Link);
await waitFor(() => getByText("Status: 501"), { container });
// Click profile menu item
const profileMenuItem = getByText(user.full_name);
- userEvent.click(profileMenuItem);
+ await userEvent.click(profileMenuItem);
// Wait for password form and therefore profile page to be rendered
const changePasswordRoute = app.router.getRoute(
@@ -248,7 +253,7 @@ test("Can show and dismiss messages", async () => {
// Click X icon and expect error message to go away, the other ones goes away by clickAway
const closeButton = getAllByTestId("message-close-button")[0];
- userEvent.click(closeButton);
+ await userEvent.click(closeButton);
await waitFor(
() =>
expect(
@@ -291,7 +296,7 @@ test("Can show configured alert", async () => {
expect(dismissButton).toBeTruthy();
// Click dismiss button and expect onDismiss callback to been called
- userEvent.click(dismissButton);
+ await userEvent.click(dismissButton);
await waitFor(() => expect(dismissed).toHaveBeenCalledTimes(1));
// Show and wait for another alert
@@ -299,7 +304,7 @@ test("Can show configured alert", async () => {
await waitFor(() => getByText("AlertTitle"), { container });
// Click agree button and expect onAgree callback to been called
- userEvent.click(getByText("AlertAgree"));
+ await userEvent.click(getByText("AlertAgree"));
await waitFor(() => expect(agreed).toHaveBeenCalledTimes(1));
});
@@ -329,12 +334,12 @@ test("Can change settings", async () => {
// Click profile menu item
const profileMenuItem = getByText(user.full_name);
- userEvent.click(profileMenuItem);
+ await userEvent.click(profileMenuItem);
// Wait for settings to be rendered and click one of them
await waitFor(() => getByText("Settings"));
const horizontal = getByLabelText("Horizontal Layout");
- userEvent.click(horizontal);
+ await userEvent.click(horizontal);
// Expect layout to change
await waitFor(() => getByTestId("navbar-appbar"));
@@ -342,7 +347,7 @@ test("Can change settings", async () => {
// Click reset button
const resetButton = getByText("Reset");
- userEvent.click(resetButton);
+ await userEvent.click(resetButton);
// Expect layout to change back
await waitFor(() => getByTestId("navbar-drawer"));
@@ -355,7 +360,7 @@ test("Can change password", async () => {
// Click profile menu item
const profileMenuItem = getByText(user.full_name);
- userEvent.click(profileMenuItem);
+ await userEvent.click(profileMenuItem);
// Wait for submit button and therefore change passsword form rendered
const submitButton = await waitFor(
@@ -373,9 +378,9 @@ test("Can change password", async () => {
const new2 = getByLabelText("Bekr\u00e4fta nytt l\u00f6senord", {
selector: "input",
});
- userEvent.type(old, "old");
- userEvent.type(new1, "new");
- userEvent.type(new2, "new");
+ await userEvent.type(old, "old");
+ await userEvent.type(new1, "new");
+ await userEvent.type(new2, "new");
// Wait for submit button to be enabled (valid filled fields)
await waitFor(() => expect(submitButton).toBeEnabled());
@@ -385,7 +390,7 @@ test("Can change password", async () => {
status: 400,
body: {},
});
- // TODO: Click button instead of submiting form; userEvent.click(submitButton);
+ // TODO: Click button instead of submiting form; await userEvent.click(submitButton);
fireEvent.submit(form);
// Expect error message to show
diff --git a/tests/forms/Form.test.js b/tests/forms/Form.test.js
index 151e058..89331a5 100644
--- a/tests/forms/Form.test.js
+++ b/tests/forms/Form.test.js
@@ -28,9 +28,7 @@ test("Ensure the default 'onSubmit' is firing a correct request", async () => {
const button = getByText("Submit");
const matcher = "http://foo.bar/api/v1.0/example/user/form/";
fetchMock.post(matcher, { body: { text: "foo" } });
- await act(async () => {
- userEvent.click(button);
- });
+ await userEvent.click(button);
await waitFor(() => success.calls);
expect(success).toHaveBeenCalledWith("Changes have been saved!");
@@ -61,9 +59,7 @@ test("Ensure the default 'onSubmit' can handle errors", async () => {
body: { text: "Invalid text", non_field_errors: ["bazrror"] },
status: 400,
});
- await act(async () => {
- userEvent.click(button);
- });
+ await userEvent.click(button);
await waitFor(() => error.calls);
expect(error).toHaveBeenCalledWith("Please correct the errors on this form.");
@@ -88,9 +84,7 @@ test("Ensure custom 'onSubmit' is called", async () => {
);
const button = getByText("Submit");
- await act(async () => {
- userEvent.click(button);
- });
+ await userEvent.click(button);
expect(onSubmit).toHaveBeenCalledTimes(1);
expect(typeof onSubmit.mock.calls[0][0].endpoint).toBe("function");