Move to Mocha for tests. Ignore files generated by sealgen
Reviewers: #reviewers Subscribers: jenkins-user Differential Revision: https://hub.sealcode.org/D1447
This commit is contained in:
parent
85fb1d29c7
commit
8009be3341
7
.gitignore
vendored
7
.gitignore
vendored
@ -36,3 +36,10 @@ cache/*
|
|||||||
uploaded-images/*
|
uploaded-images/*
|
||||||
!uploaded-images/keepme
|
!uploaded-images/keepme
|
||||||
uploaded_files
|
uploaded_files
|
||||||
|
/dist-instrumented/
|
||||||
|
|
||||||
|
# these are autogenerated, no need to version control them
|
||||||
|
src/back/jdd-components/components.ts
|
||||||
|
src/back/routes/routes.ts
|
||||||
|
src/back/routes/urls.ts
|
||||||
|
src/includes.css
|
497
package-lock.json
generated
497
package-lock.json
generated
@ -51,7 +51,8 @@
|
|||||||
"eslint-config-prettier": "^7.2.0",
|
"eslint-config-prettier": "^7.2.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"kill-port": "^1.6.1",
|
"kill-port": "^1.6.1",
|
||||||
"mri": "^1.1.6",
|
"mocha": "^10.4.0",
|
||||||
|
"mri": "^1.2.0",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"ts-loader": "^8.0.14",
|
"ts-loader": "^8.0.14",
|
||||||
@ -2509,6 +2510,12 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/browser-stdout": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/browserslist": {
|
"node_modules/browserslist": {
|
||||||
"version": "4.23.0",
|
"version": "4.23.0",
|
||||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
|
||||||
@ -4495,6 +4502,15 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/flat": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"flat": "cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
|
||||||
@ -4630,6 +4646,19 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
@ -5464,6 +5493,15 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-plain-obj": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-regex": {
|
"node_modules/is-regex": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
||||||
@ -5553,6 +5591,18 @@
|
|||||||
"integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
|
"integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/is-unicode-supported": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-weakref": {
|
"node_modules/is-weakref": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
|
||||||
@ -6484,6 +6534,92 @@
|
|||||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/log-symbols": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"chalk": "^4.1.0",
|
||||||
|
"is-unicode-supported": "^0.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/ansi-styles": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/chalk": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
|
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.1.0",
|
||||||
|
"supports-color": "^7.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/color-convert": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"color-name": "~1.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/color-name": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/has-flag": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/log-symbols/node_modules/supports-color": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"has-flag": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/loupe": {
|
"node_modules/loupe": {
|
||||||
"version": "2.3.7",
|
"version": "2.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
|
||||||
@ -7275,6 +7411,306 @@
|
|||||||
"ufo": "^1.3.2"
|
"ufo": "^1.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/mocha": {
|
||||||
|
"version": "10.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz",
|
||||||
|
"integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-colors": "4.1.1",
|
||||||
|
"browser-stdout": "1.3.1",
|
||||||
|
"chokidar": "3.5.3",
|
||||||
|
"debug": "4.3.4",
|
||||||
|
"diff": "5.0.0",
|
||||||
|
"escape-string-regexp": "4.0.0",
|
||||||
|
"find-up": "5.0.0",
|
||||||
|
"glob": "8.1.0",
|
||||||
|
"he": "1.2.0",
|
||||||
|
"js-yaml": "4.1.0",
|
||||||
|
"log-symbols": "4.1.0",
|
||||||
|
"minimatch": "5.0.1",
|
||||||
|
"ms": "2.1.3",
|
||||||
|
"serialize-javascript": "6.0.0",
|
||||||
|
"strip-json-comments": "3.1.1",
|
||||||
|
"supports-color": "8.1.1",
|
||||||
|
"workerpool": "6.2.1",
|
||||||
|
"yargs": "16.2.0",
|
||||||
|
"yargs-parser": "20.2.4",
|
||||||
|
"yargs-unparser": "2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"_mocha": "bin/_mocha",
|
||||||
|
"mocha": "bin/mocha.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/ansi-colors": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/argparse": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/brace-expansion": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/chokidar": {
|
||||||
|
"version": "3.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||||
|
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"anymatch": "~3.1.2",
|
||||||
|
"braces": "~3.0.2",
|
||||||
|
"glob-parent": "~5.1.2",
|
||||||
|
"is-binary-path": "~2.1.0",
|
||||||
|
"is-glob": "~4.0.1",
|
||||||
|
"normalize-path": "~3.0.0",
|
||||||
|
"readdirp": "~3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8.10.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/cliui": {
|
||||||
|
"version": "7.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
|
||||||
|
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"strip-ansi": "^6.0.0",
|
||||||
|
"wrap-ansi": "^7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/diff": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/escape-string-regexp": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/find-up": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"locate-path": "^6.0.0",
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/glob": {
|
||||||
|
"version": "8.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
|
||||||
|
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"fs.realpath": "^1.0.0",
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "^5.0.1",
|
||||||
|
"once": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/has-flag": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/js-yaml": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"argparse": "^2.0.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"js-yaml": "bin/js-yaml.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/locate-path": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"p-locate": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/minimatch": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/p-limit": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"yocto-queue": "^0.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/p-locate": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"p-limit": "^3.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/serialize-javascript": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"randombytes": "^2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/supports-color": {
|
||||||
|
"version": "8.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||||
|
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"has-flag": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/yargs": {
|
||||||
|
"version": "16.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||||
|
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^7.0.2",
|
||||||
|
"escalade": "^3.1.1",
|
||||||
|
"get-caller-file": "^2.0.5",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"y18n": "^5.0.5",
|
||||||
|
"yargs-parser": "^20.2.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/yargs-parser": {
|
||||||
|
"version": "20.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
|
||||||
|
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mocha/node_modules/yocto-queue": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mongodb": {
|
"node_modules/mongodb": {
|
||||||
"version": "6.5.0",
|
"version": "6.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz",
|
||||||
@ -8271,6 +8707,19 @@
|
|||||||
"node": ">=16"
|
"node": ">=16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/playwright/node_modules/fsevents": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/possible-typed-array-names": {
|
"node_modules/possible-typed-array-names": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
|
||||||
@ -8557,7 +9006,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"safe-buffer": "^5.1.0"
|
"safe-buffer": "^5.1.0"
|
||||||
}
|
}
|
||||||
@ -11211,6 +11659,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
|
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
|
||||||
},
|
},
|
||||||
|
"node_modules/workerpool": {
|
||||||
|
"version": "6.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
|
||||||
|
"integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/wrap-ansi": {
|
"node_modules/wrap-ansi": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
@ -11387,6 +11841,45 @@
|
|||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/yargs-unparser": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": "^6.0.0",
|
||||||
|
"decamelize": "^4.0.0",
|
||||||
|
"flat": "^5.0.2",
|
||||||
|
"is-plain-obj": "^2.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-unparser/node_modules/camelcase": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
|
||||||
|
"integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-unparser/node_modules/decamelize": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ylru": {
|
"node_modules/ylru": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/ylru/-/ylru-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/ylru/-/ylru-1.4.0.tgz",
|
||||||
|
31
package.json
31
package.json
@ -9,19 +9,23 @@
|
|||||||
"start-watch": "SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon --enable-source-maps .",
|
"start-watch": "SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon --enable-source-maps .",
|
||||||
"typecheck:back": "tsc --noEmit --target es6 --lib es2021,dom -p tsconfig-back.json",
|
"typecheck:back": "tsc --noEmit --target es6 --lib es2021,dom -p tsconfig-back.json",
|
||||||
"typecheck:front": "tsc --noEmit --target es6 --lib es2015,dom -p tsconfig-front.json",
|
"typecheck:front": "tsc --noEmit --target es6 --lib es2015,dom -p tsconfig-front.json",
|
||||||
|
"typecheck": "npm run typecheck:back && npm run typecheck:front",
|
||||||
"prewatch": "rm -rf dist/* && npm run build",
|
"prewatch": "rm -rf dist/* && npm run build",
|
||||||
"build": "sealgen build",
|
"build": "rm -rf dist && sealgen build && npm run lint && npm run typecheck",
|
||||||
"watch": "multiple-scripts-tmux -p watch",
|
"watch": "multiple-scripts-tmux -p watch",
|
||||||
"reset-db": "docker-compose down && docker-compose up -d",
|
"reset-db": "docker-compose down && docker-compose up -d",
|
||||||
"install-test-deps": "npx playwright install firefox",
|
"install-test-deps": "npx playwright install firefox",
|
||||||
"pretest-cmd": "rm -rf dist && npm run build",
|
"postinstall": "npm run install-test-deps",
|
||||||
"test-cmd": "vitest --config ./src/back/vitest.config.ts",
|
"pretest": "npm run build && docker-compose up -d",
|
||||||
"test-cmd-once": "vitest run --config ./src/back/vitest.config.ts",
|
"test": "node test.cjs",
|
||||||
"test": "npm run test-cmd -- --ui",
|
"prepare": "npm run build",
|
||||||
"coverage": "npm run test --coverage",
|
"lint": "eslint src",
|
||||||
"postinstall": "sealgen make-env && npm install --prefix webhint && npm run install-test-deps",
|
"preinstrument": "npm run build && rm -fr .xunit coverage dist-instrumented",
|
||||||
"test-reports": "rm -f .xunit && npm run test-cmd-once -- --coverage --reporter=junit --outputFile=.xunit",
|
"instrument": "npx nyc instrument --exclude \"\" dist dist-instrumented",
|
||||||
"show-coverage": "npm run test-reports; xdg-open coverage/index.html"
|
"pretest-reports": "npm run instrument && docker-compose up -d",
|
||||||
|
"test-reports": "npx nyc --exclude \"\" ./node_modules/.bin/mocha --recursive --timeout=10000 --require source-map-support/register --reporter xunit --reporter-option output=.xunit 'dist-instrumented/**/*.test.js' --exit && nyc report --reporter clover --exclude \"\"",
|
||||||
|
"precover-html": "rm -rf coverate/lcov-report",
|
||||||
|
"cover-html": "npm run test-reports && nyc report --reporter lcov --exclude \"\" && xdg-open coverage/lcov-report/index.html"
|
||||||
},
|
},
|
||||||
"tmux-scripts": {
|
"tmux-scripts": {
|
||||||
"watch": [
|
"watch": [
|
||||||
@ -55,8 +59,7 @@
|
|||||||
"qs": "^6.12.0",
|
"qs": "^6.12.0",
|
||||||
"sealious": "^0.19.6",
|
"sealious": "^0.19.6",
|
||||||
"stimulus": "^2.0.0",
|
"stimulus": "^2.0.0",
|
||||||
"tempstream": "^0.3.15",
|
"tempstream": "^0.3.15"
|
||||||
"vitest": "^1.1.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sealcode/ansi-html-stream": "^1.0.1",
|
"@sealcode/ansi-html-stream": "^1.0.1",
|
||||||
@ -67,15 +70,13 @@
|
|||||||
"@types/uuid": "^9.0.8",
|
"@types/uuid": "^9.0.8",
|
||||||
"@typescript-eslint/eslint-plugin": "7.4",
|
"@typescript-eslint/eslint-plugin": "7.4",
|
||||||
"@typescript-eslint/parser": "7.4",
|
"@typescript-eslint/parser": "7.4",
|
||||||
"@vitest/coverage-istanbul": "^1.1.0",
|
|
||||||
"@vitest/coverage-v8": "^1.1.0",
|
|
||||||
"@vitest/ui": "^1.1.0",
|
|
||||||
"axios": "^1.6.2",
|
"axios": "^1.6.2",
|
||||||
"eslint": "8.57",
|
"eslint": "8.57",
|
||||||
"eslint-config-prettier": "^7.2.0",
|
"eslint-config-prettier": "^7.2.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"kill-port": "^1.6.1",
|
"kill-port": "^1.6.1",
|
||||||
"mri": "^1.1.6",
|
"mocha": "^10.4.0",
|
||||||
|
"mri": "^1.2.0",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"ts-loader": "^8.0.14",
|
"ts-loader": "^8.0.14",
|
||||||
|
@ -15,54 +15,46 @@ describe("password-reset-intents", function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
it(
|
it("tells you if the email address doesn't exist", async function () {
|
||||||
"tells you if the email address doesn't exist",
|
return withProdApp(async ({ app, base_url }) => {
|
||||||
async function () {
|
const email = "fake@example.com";
|
||||||
return withProdApp(async ({ app, base_url }) => {
|
try {
|
||||||
const email = "fake@example.com";
|
await axios.post(
|
||||||
try {
|
`${base_url}/api/v1/collections/password-reset-intents`,
|
||||||
await axios.post(
|
|
||||||
`${base_url}/api/v1/collections/password-reset-intents`,
|
|
||||||
{
|
|
||||||
email: email,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
assert.equal(
|
|
||||||
e.response.data.data.field_messages.email.message,
|
|
||||||
app.i18n("invalid_existing_value", ["users", "email", email])
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new Error("it didn't throw");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
|
||||||
"allows anyone to create an intent, if the email exists",
|
|
||||||
async () =>
|
|
||||||
withProdApp(async ({ app, base_url }) => {
|
|
||||||
await createAUser(app);
|
|
||||||
const { email, token } = (
|
|
||||||
await axios.post(
|
|
||||||
`${base_url}/api/v1/collections/password-reset-intents`,
|
|
||||||
{
|
|
||||||
email: "user@example.com",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
).data;
|
|
||||||
assert.deepEqual(
|
|
||||||
{ email, token },
|
|
||||||
{
|
{
|
||||||
email: "user@example.com",
|
email: email,
|
||||||
token: "it's a secret to everybody",
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}),
|
} catch (e) {
|
||||||
LONG_TEST_TIMEOUT
|
assert.equal(
|
||||||
);
|
e.response.data.data.field_messages.email.message,
|
||||||
|
app.i18n("invalid_existing_value", ["users", "email", email])
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error("it didn't throw");
|
||||||
|
});
|
||||||
|
}).timeout(LONG_TEST_TIMEOUT);
|
||||||
|
|
||||||
|
it("allows anyone to create an intent, if the email exists", async () =>
|
||||||
|
withProdApp(async ({ app, base_url }) => {
|
||||||
|
await createAUser(app);
|
||||||
|
const { email, token } = (
|
||||||
|
await axios.post(
|
||||||
|
`${base_url}/api/v1/collections/password-reset-intents`,
|
||||||
|
{
|
||||||
|
email: "user@example.com",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
).data;
|
||||||
|
assert.deepEqual(
|
||||||
|
{ email, token },
|
||||||
|
{
|
||||||
|
email: "user@example.com",
|
||||||
|
token: "it's a secret to everybody",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})).timeout(LONG_TEST_TIMEOUT);
|
||||||
|
|
||||||
it("tells you if the email address is malformed", async () =>
|
it("tells you if the email address is malformed", async () =>
|
||||||
withProdApp(async ({ app, base_url }) => {
|
withProdApp(async ({ app, base_url }) => {
|
||||||
|
@ -7,31 +7,27 @@ import Users from "./users.js";
|
|||||||
import { LONG_TEST_TIMEOUT } from "../test_utils/webhint.js";
|
import { LONG_TEST_TIMEOUT } from "../test_utils/webhint.js";
|
||||||
|
|
||||||
describe("user-roles", () => {
|
describe("user-roles", () => {
|
||||||
it(
|
it("rejects when given an empty role", async () =>
|
||||||
"rejects when given an empty role",
|
withProdApp(async ({ app, rest_api }) => {
|
||||||
async () =>
|
const [user, session] = await createAdmin(app, rest_api);
|
||||||
withProdApp(async ({ app, rest_api }) => {
|
await TestUtils.assertThrowsAsync(
|
||||||
const [user, session] = await createAdmin(app, rest_api);
|
async () => {
|
||||||
await TestUtils.assertThrowsAsync(
|
return rest_api.post(
|
||||||
async () => {
|
`/api/v1/collections/user-roles`,
|
||||||
return rest_api.post(
|
{
|
||||||
`/api/v1/collections/user-roles`,
|
user: user.id,
|
||||||
{
|
},
|
||||||
user: user.id,
|
session
|
||||||
},
|
);
|
||||||
session
|
},
|
||||||
);
|
(e) => {
|
||||||
},
|
assert.equal(
|
||||||
(e) => {
|
e?.response.data.data.field_messages.role?.message,
|
||||||
assert.equal(
|
"Missing value for field 'role'."
|
||||||
e?.response.data.data.field_messages.role?.message,
|
);
|
||||||
"Missing value for field 'role'."
|
}
|
||||||
);
|
);
|
||||||
}
|
})).timeout(LONG_TEST_TIMEOUT);
|
||||||
);
|
|
||||||
}),
|
|
||||||
LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it("accepts correct dataset", async () =>
|
it("accepts correct dataset", async () =>
|
||||||
withProdApp(async ({ app, base_url, rest_api }) => {
|
withProdApp(async ({ app, base_url, rest_api }) => {
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
// DO NOT EDIT! This file is generated automaticaly with 'npm run generate-components'
|
|
||||||
import { Registry } from "@sealcode/jdd";
|
|
||||||
|
|
||||||
export const registry = new Registry();
|
|
||||||
|
|
||||||
import { AutoscrollingImages } from "./autoscrolling-images/autoscrolling-images.jdd.js";
|
|
||||||
registry.add("autoscrolling-images", AutoscrollingImages);
|
|
||||||
|
|
||||||
import { FaqComponent } from "./faq-component/faq-component.jdd.js";
|
|
||||||
registry.add("faq-component", FaqComponent);
|
|
||||||
|
|
||||||
import { HeaderWithImage } from "./header-with-image/header-with-image.jdd.js";
|
|
||||||
registry.add("header-with-image", HeaderWithImage);
|
|
||||||
|
|
||||||
import { ImageDemo } from "./image-demo/image-demo.jdd.js";
|
|
||||||
registry.add("image-demo", ImageDemo);
|
|
||||||
|
|
||||||
import { MapWithPins } from "./map-with-pins/map-with-pins.jdd.js";
|
|
||||||
registry.add("map-with-pins", MapWithPins);
|
|
||||||
|
|
||||||
import { NiceBox } from "./nice-box/nice-box.jdd.js";
|
|
||||||
registry.add("nice-box", NiceBox);
|
|
||||||
|
|
||||||
import { Table } from "./table/table.jdd.js";
|
|
||||||
registry.add("table", Table);
|
|
@ -3,18 +3,14 @@ import { withProdApp } from "../test_utils/with-prod-app.js";
|
|||||||
import { HelloURL } from "./urls.js";
|
import { HelloURL } from "./urls.js";
|
||||||
|
|
||||||
describe("Hello", () => {
|
describe("Hello", () => {
|
||||||
it(
|
it("doesn't crash", async function () {
|
||||||
"doesn't crash",
|
return withProdApp(async ({ base_url, rest_api }) => {
|
||||||
async function () {
|
await rest_api.get(HelloURL);
|
||||||
return withProdApp(async ({ base_url, rest_api }) => {
|
await webhintURL(base_url + HelloURL);
|
||||||
await rest_api.get(HelloURL);
|
// alternatively you can use webhintHTML for faster but less precise scans
|
||||||
await webhintURL(base_url + HelloURL);
|
// or for scanning responses of requests that use some form of authorization:
|
||||||
// alternatively you can use webhintHTML for faster but less precise scans
|
// const response = await rest_api.get(HelloURL);
|
||||||
// or for scanning responses of requests that use some form of authorization:
|
// await webhintHTML(response);
|
||||||
// const response = await rest_api.get(HelloURL);
|
});
|
||||||
// await webhintHTML(response);
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
@ -2,12 +2,8 @@ import { VERY_LONG_TEST_TIMEOUT, webhintURL } from "../test_utils/webhint.js";
|
|||||||
import { withProdApp } from "../test_utils/with-prod-app.js";
|
import { withProdApp } from "../test_utils/with-prod-app.js";
|
||||||
|
|
||||||
describe("homepage", function () {
|
describe("homepage", function () {
|
||||||
it(
|
it("passes webhint tests", () =>
|
||||||
"passes webhint tests",
|
withProdApp(async ({ base_url }) => {
|
||||||
() =>
|
await webhintURL(`${base_url}/`);
|
||||||
withProdApp(async ({ base_url }) => {
|
})).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
await webhintURL(`${base_url}/`);
|
|
||||||
}),
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ import { LONG_TEST_TIMEOUT } from "../test_utils/webhint.js";
|
|||||||
import { withProdApp } from "../test_utils/with-prod-app.js";
|
import { withProdApp } from "../test_utils/with-prod-app.js";
|
||||||
import { LogoutURL, SignInURL } from "./urls.js";
|
import { LogoutURL, SignInURL } from "./urls.js";
|
||||||
|
|
||||||
describe.concurrent("Logout", () => {
|
describe("Logout", () => {
|
||||||
let page: Page;
|
let page: Page;
|
||||||
let browser: Browser;
|
let browser: Browser;
|
||||||
let context: BrowserContext;
|
let context: BrowserContext;
|
||||||
@ -23,23 +23,19 @@ describe.concurrent("Logout", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("logout test", () => {
|
describe("logout test", () => {
|
||||||
it(
|
it("logout", async function () {
|
||||||
"logout",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill(password);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill(password);
|
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await page.getByRole("link", { name: "Logout" }).click();
|
||||||
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
await page.getByRole("link", { name: "Logout" }).click();
|
});
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
}).timeout(LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
|
|
||||||
|
|
||||||
import type Router from "@koa/router";
|
|
||||||
import { mount } from "@sealcode/sealgen";
|
|
||||||
import * as URLs from "./urls.js";
|
|
||||||
|
|
||||||
import { default as Components } from "./components.sreact.js";
|
|
||||||
import { default as Hello } from "./hello.page.js";
|
|
||||||
import { default as Logout } from "./logout.redirect.js";
|
|
||||||
import { default as SignIn } from "./signIn.form.js";
|
|
||||||
import { default as SignUp } from "./signUp.form.js";
|
|
||||||
import { default as Todo } from "./todo.form.js";
|
|
||||||
|
|
||||||
export default function mountAutoRoutes(router: Router) {
|
|
||||||
mount(router, URLs.ComponentsURL, Components);
|
|
||||||
mount(router, URLs.HelloURL, Hello);
|
|
||||||
mount(router, URLs.LogoutURL, Logout);
|
|
||||||
mount(router, URLs.SignInURL, SignIn);
|
|
||||||
mount(router, URLs.SignUpURL, SignUp);
|
|
||||||
mount(router, URLs.TodoURL, Todo);
|
|
||||||
}
|
|
@ -8,105 +8,85 @@ describe("SignIn", () => {
|
|||||||
const username = ADMIN_CREDENTIALS.username;
|
const username = ADMIN_CREDENTIALS.username;
|
||||||
const password = ADMIN_CREDENTIALS.password;
|
const password = ADMIN_CREDENTIALS.password;
|
||||||
|
|
||||||
it(
|
it("doesn't crash", async function () {
|
||||||
"doesn't crash",
|
return withProdApp(async ({ base_url, rest_api }) => {
|
||||||
async function () {
|
await rest_api.get(SignInURL);
|
||||||
return withProdApp(async ({ base_url, rest_api }) => {
|
await webhintURL(base_url + SignInURL);
|
||||||
await rest_api.get(SignInURL);
|
// alternatively you can use webhintHTML for faster but less precise scans
|
||||||
await webhintURL(base_url + SignInURL);
|
// or for scanning responses of requests that use some form of authorization:
|
||||||
// alternatively you can use webhintHTML for faster but less precise scans
|
// const response = await rest_api.get(SignInURL);
|
||||||
// or for scanning responses of requests that use some form of authorization:
|
// await webhintHTML(response);
|
||||||
// const response = await rest_api.get(SignInURL);
|
});
|
||||||
// await webhintHTML(response);
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
describe("can access test", () => {
|
describe("can access test", () => {
|
||||||
it(
|
it("access url", async function () {
|
||||||
"access url",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
const { context, page } = await getPage();
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.goto(base_url);
|
||||||
const { context, page } = await getPage();
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill(password);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill(password);
|
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await page.goto(base_url + SignInURL);
|
||||||
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
await page.waitForSelector('body:has-text("no access")');
|
||||||
await page.goto(base_url + SignInURL);
|
await page.goto(base_url);
|
||||||
await page.waitForSelector('body:has-text("no access")');
|
await page.getByRole("link", { name: "Logout" }).click();
|
||||||
await page.goto(base_url);
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
await page.getByRole("link", { name: "Logout" }).click();
|
await context.close();
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
});
|
||||||
await context.close();
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("sign in test", () => {
|
describe("sign in test", () => {
|
||||||
it(
|
it("wrong username", async function () {
|
||||||
"wrong username",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
const { context, page } = await getPage();
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.goto(base_url);
|
||||||
const { context, page } = await getPage();
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill("username20230720722");
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill("username20230720722");
|
await page.getByPlaceholder("password").fill("test");
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill("test");
|
await page.waitForSelector(".form-message");
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await context.close();
|
||||||
await page.waitForSelector(".form-message");
|
});
|
||||||
await context.close();
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("correct username and password", async function () {
|
||||||
"correct username and password",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
const { context, page } = await getPage();
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.goto(base_url);
|
||||||
const { context, page } = await getPage();
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill(password);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill(password);
|
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await page.getByRole("link", { name: "Logout" }).click();
|
||||||
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
await page.getByRole("link", { name: "Logout" }).click();
|
await context.close();
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
});
|
||||||
await context.close();
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("wrong password", async function () {
|
||||||
"wrong password",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
const { context, page } = await getPage();
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.goto(base_url);
|
||||||
const { context, page } = await getPage();
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill("asddasads20230720722");
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill("asddasads20230720722");
|
await page.waitForSelector(".form-message");
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await context.close();
|
||||||
await page.waitForSelector(".form-message");
|
});
|
||||||
await context.close();
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,16 +6,12 @@ import { withProdApp } from "../test_utils/with-prod-app.js";
|
|||||||
import { LogoutURL, SignInURL, SignUpURL } from "./urls.js";
|
import { LogoutURL, SignInURL, SignUpURL } from "./urls.js";
|
||||||
|
|
||||||
describe("SignUp webhint", () => {
|
describe("SignUp webhint", () => {
|
||||||
it(
|
it("doesn't crash", async function () {
|
||||||
"doesn't crash",
|
return withProdApp(async ({ base_url, rest_api }) => {
|
||||||
async function () {
|
await rest_api.get(SignUpURL);
|
||||||
return withProdApp(async ({ base_url, rest_api }) => {
|
await webhintURL(base_url + SignUpURL);
|
||||||
await rest_api.get(SignUpURL);
|
});
|
||||||
await webhintURL(base_url + SignUpURL);
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("SignUp", () => {
|
describe("SignUp", () => {
|
||||||
@ -37,109 +33,85 @@ describe("SignUp", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("signup test", () => {
|
describe("signup test", () => {
|
||||||
it(
|
it("username is taken", async function () {
|
||||||
"username is taken",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign up" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign up" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("email").fill("user0192939@randomsuper.com");
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("email").press("Tab");
|
||||||
await page
|
await page.getByPlaceholder("password").fill("user12341234");
|
||||||
.getByPlaceholder("email")
|
await page.getByRole("button", { name: "Wyślij" }).click();
|
||||||
.fill("user0192939@randomsuper.com");
|
await page.waitForSelector(".input__error");
|
||||||
await page.getByPlaceholder("email").press("Tab");
|
});
|
||||||
await page.getByPlaceholder("password").fill("user12341234");
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
await page.getByRole("button", { name: "Wyślij" }).click();
|
|
||||||
await page.waitForSelector(".input__error");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("password is too shot ", async function () {
|
||||||
"password is too shot ",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign up" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign up" }).click();
|
await page.getByPlaceholder("text").fill("dasdsa");
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("email").click();
|
||||||
await page.getByPlaceholder("text").fill("dasdsa");
|
await page
|
||||||
await page.getByPlaceholder("email").click();
|
.getByPlaceholder("email")
|
||||||
await page
|
.fill("asasdsdadsadss123asddsa@asdasca.com");
|
||||||
.getByPlaceholder("email")
|
await page.getByPlaceholder("password").click();
|
||||||
.fill("asasdsdadsadss123asddsa@asdasca.com");
|
await page.getByPlaceholder("password").fill("asddsa");
|
||||||
await page.getByPlaceholder("password").click();
|
await page.getByRole("button", { name: "Wyślij" }).click();
|
||||||
await page.getByPlaceholder("password").fill("asddsa");
|
await page.waitForSelector(".form-message.form-message--error");
|
||||||
await page.getByRole("button", { name: "Wyślij" }).click();
|
});
|
||||||
await page.waitForSelector(".form-message.form-message--error");
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("email is taken", async function () {
|
||||||
"email is taken",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign up" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign up" }).click();
|
await page.getByPlaceholder("text").fill("ranomusername2023072722");
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill("ranomusername2023072722");
|
await page.getByPlaceholder("email").fill(email);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("email").press("Tab");
|
||||||
await page.getByPlaceholder("email").fill(email);
|
await page.getByPlaceholder("password").fill("asdasdasdasdasd");
|
||||||
await page.getByPlaceholder("email").press("Tab");
|
await page.getByRole("button", { name: "Wyślij" }).click();
|
||||||
await page.getByPlaceholder("password").fill("asdasdasdasdasd");
|
await page.waitForSelector(".form-message.form-message--error");
|
||||||
await page.getByRole("button", { name: "Wyślij" }).click();
|
});
|
||||||
await page.waitForSelector(".form-message.form-message--error");
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("correct", async function () {
|
||||||
"correct",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign up" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign up" }).click();
|
await page.getByPlaceholder("text").fill("ranomusername20230720722");
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill("ranomusername20230720722");
|
await page.getByPlaceholder("email").fill("radomemail@emailrandom.com");
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("email").press("Tab");
|
||||||
await page
|
await page.getByPlaceholder("password").fill("asdasdasdasdasd");
|
||||||
.getByPlaceholder("email")
|
await page.getByRole("button", { name: "Wyślij" }).click();
|
||||||
.fill("radomemail@emailrandom.com");
|
await page.waitForSelector(".success-notify");
|
||||||
await page.getByPlaceholder("email").press("Tab");
|
});
|
||||||
await page.getByPlaceholder("password").fill("asdasdasdasdasd");
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
await page.getByRole("button", { name: "Wyślij" }).click();
|
|
||||||
await page.waitForSelector(".success-notify");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
describe("can access test", () => {
|
describe("can access test", () => {
|
||||||
it(
|
it("access url", async function () {
|
||||||
"access url",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill(password);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill(password);
|
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await page.goto(base_url + SignUpURL);
|
||||||
await page.waitForSelector(`a[href="${LogoutURL}"]`);
|
await page.waitForSelector('body:has-text("no access")');
|
||||||
await page.goto(base_url + SignUpURL);
|
await page.goto(base_url);
|
||||||
await page.waitForSelector('body:has-text("no access")');
|
await page.getByRole("link", { name: "Logout" }).click();
|
||||||
await page.goto(base_url);
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
await page.getByRole("link", { name: "Logout" }).click();
|
});
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -7,25 +7,21 @@ import { withProdApp } from "../test_utils/with-prod-app.js";
|
|||||||
import { SignInURL, TodoURL } from "./urls.js";
|
import { SignInURL, TodoURL } from "./urls.js";
|
||||||
|
|
||||||
describe("Todo webhint", () => {
|
describe("Todo webhint", () => {
|
||||||
it(
|
it("doesn't crash", async function () {
|
||||||
"doesn't crash",
|
return withProdApp(async ({ rest_api }) => {
|
||||||
async function () {
|
await assert.rejects(
|
||||||
return withProdApp(async ({ rest_api }) => {
|
async () => {
|
||||||
await assert.rejects(
|
await rest_api.get(TodoURL);
|
||||||
async () => {
|
},
|
||||||
await rest_api.get(TodoURL);
|
{
|
||||||
|
response: {
|
||||||
|
data: "no access",
|
||||||
|
status: 403,
|
||||||
},
|
},
|
||||||
{
|
}
|
||||||
response: {
|
);
|
||||||
data: "no access",
|
});
|
||||||
status: 403,
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Todo", function () {
|
describe("Todo", function () {
|
||||||
@ -46,54 +42,44 @@ describe("Todo", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("todo test", () => {
|
describe("todo test", () => {
|
||||||
it(
|
it("create and delete task", async function () {
|
||||||
"create and delete task",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
await page.getByRole("link", { name: "Sign in" }).click();
|
||||||
await page.goto(base_url);
|
await page.getByPlaceholder("text").click();
|
||||||
await page.getByRole("link", { name: "Sign in" }).click();
|
await page.getByPlaceholder("text").fill(username);
|
||||||
await page.getByPlaceholder("text").click();
|
await page.getByPlaceholder("text").press("Tab");
|
||||||
await page.getByPlaceholder("text").fill(username);
|
await page.getByPlaceholder("password").fill(password);
|
||||||
await page.getByPlaceholder("text").press("Tab");
|
await page.getByPlaceholder("password").press("Enter");
|
||||||
await page.getByPlaceholder("password").fill(password);
|
await page.getByRole("link", { name: "To do app" }).click();
|
||||||
await page.getByPlaceholder("password").press("Enter");
|
await page.getByPlaceholder("Write an Matrix bot").click();
|
||||||
await page.getByRole("link", { name: "To do app" }).click();
|
await page.getByPlaceholder("Write an Matrix bot").fill("randomtasdk");
|
||||||
await page.getByPlaceholder("Write an Matrix bot").click();
|
await page.getByRole("button", { name: "Wyślij" }).click();
|
||||||
await page
|
await page.waitForSelector(".form-message.form-message--success");
|
||||||
.getByPlaceholder("Write an Matrix bot")
|
await page.locator("turbo-frame").getByRole("checkbox").check();
|
||||||
.fill("randomtasdk");
|
await page.locator("turbo-frame").getByRole("checkbox").uncheck();
|
||||||
await page.getByRole("button", { name: "Wyślij" }).click();
|
await page
|
||||||
await page.waitForSelector(".form-message.form-message--success");
|
.locator("turbo-frame")
|
||||||
await page.locator("turbo-frame").getByRole("checkbox").check();
|
.getByRole("button", { name: "Delete" })
|
||||||
await page.locator("turbo-frame").getByRole("checkbox").uncheck();
|
.click();
|
||||||
await page
|
await page.getByRole("link", { name: "Logout" }).click();
|
||||||
.locator("turbo-frame")
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
.getByRole("button", { name: "Delete" })
|
});
|
||||||
.click();
|
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||||
await page.getByRole("link", { name: "Logout" }).click();
|
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("can access test", () => {
|
describe("can access test", () => {
|
||||||
it(
|
it("access url", async function () {
|
||||||
"access url",
|
await withProdApp(async ({ base_url }) => {
|
||||||
async function () {
|
await page.goto(base_url);
|
||||||
await withProdApp(async ({ base_url }) => {
|
try {
|
||||||
await page.goto(base_url);
|
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
||||||
try {
|
await page.goto(base_url + TodoURL);
|
||||||
await page.waitForSelector(`a[href="${SignInURL}"]`);
|
await page.waitForSelector('body:has-text("no access")');
|
||||||
await page.goto(base_url + TodoURL);
|
} catch (error) {
|
||||||
await page.waitForSelector('body:has-text("no access")');
|
console.error(error);
|
||||||
} catch (error) {
|
}
|
||||||
console.error(error);
|
});
|
||||||
}
|
}).timeout(LONG_TEST_TIMEOUT);
|
||||||
});
|
|
||||||
},
|
|
||||||
LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
export const ComponentsURL = "/components/";
|
|
||||||
export const HelloURL = "/hello/";
|
|
||||||
export const LogoutURL = "/logout/";
|
|
||||||
export const SignInURL = "/signIn/";
|
|
||||||
export const SignUpURL = "/signUp/";
|
|
||||||
export const TodoURL = "/todo/";
|
|
@ -1,5 +0,0 @@
|
|||||||
import { closeBrowser } from "./test_utils/browser-creator.js";
|
|
||||||
|
|
||||||
afterAll(async () => {
|
|
||||||
await closeBrowser();
|
|
||||||
});
|
|
@ -1,5 +1,6 @@
|
|||||||
import _locreq from "locreq";
|
import _locreq from "locreq";
|
||||||
const locreq = _locreq(__dirname);
|
import { module_dirname } from "../utils/module_dirname.js";
|
||||||
|
const locreq = _locreq(module_dirname(import.meta.url));
|
||||||
import { spawn } from "child_process";
|
import { spawn } from "child_process";
|
||||||
import { hasShape, is, predicates } from "@sealcode/ts-predicates";
|
import { hasShape, is, predicates } from "@sealcode/ts-predicates";
|
||||||
import { promises as fs } from "fs";
|
import { promises as fs } from "fs";
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
import { defineConfig } from "vitest/config";
|
|
||||||
|
|
||||||
// we're testing from the build 'dist' directory
|
|
||||||
const exclude = ["docker_node_modules", "node_modules", "src", "lib", "webhint"];
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
test: {
|
|
||||||
testTimeout: 10000,
|
|
||||||
setupFiles: ["src/back/test-teardown.ts"],
|
|
||||||
exclude,
|
|
||||||
globals: true,
|
|
||||||
coverage: {
|
|
||||||
exclude,
|
|
||||||
enabled: true,
|
|
||||||
all: true,
|
|
||||||
include: ["dist/**"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,14 +0,0 @@
|
|||||||
/* DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-css-includes */
|
|
||||||
|
|
||||||
@import "../node_modules/@sealcode/sealgen/src/forms/forms.css";
|
|
||||||
@import "back/jdd-components/autoscrolling-images/autoscrolling-images.css";
|
|
||||||
@import "back/jdd-components/faq-component/faq-component.css";
|
|
||||||
@import "back/jdd-components/header-with-image/header-with-image.css";
|
|
||||||
@import "back/jdd-components/image-demo/image-demo.css";
|
|
||||||
@import "back/jdd-components/map-with-pins/map-with-pins.css";
|
|
||||||
@import "back/jdd-components/nice-box/nice-box.css";
|
|
||||||
@import "back/jdd-components/table/table.css";
|
|
||||||
@import "back/routes/common/ui/input.css";
|
|
||||||
@import "back/routes/components.css";
|
|
||||||
@import "colors.css";
|
|
||||||
@import "tables.css";
|
|
54
test.cjs
Normal file
54
test.cjs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
const mri = require("mri");
|
||||||
|
const { spawn } = require("child_process");
|
||||||
|
|
||||||
|
const argv = process.argv.slice(2);
|
||||||
|
const args = mri(argv);
|
||||||
|
|
||||||
|
const bin_dir = "./node_modules/.bin/";
|
||||||
|
|
||||||
|
const mocha = bin_dir + "mocha";
|
||||||
|
|
||||||
|
let mocha_options = [
|
||||||
|
"--recursive",
|
||||||
|
"--timeout=100000",
|
||||||
|
"--require",
|
||||||
|
"source-map-support/register",
|
||||||
|
"--exit",
|
||||||
|
];
|
||||||
|
|
||||||
|
if (args["test-report"]) {
|
||||||
|
mocha_options = [
|
||||||
|
...mocha_options,
|
||||||
|
// "--require",
|
||||||
|
// "ts-node/register",
|
||||||
|
// "--require",
|
||||||
|
// "./src/http/type-overrides.ts",
|
||||||
|
"--reporter",
|
||||||
|
"xunit",
|
||||||
|
"--reporter-option",
|
||||||
|
"output=.xunit",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
const mocha_files = ["dist/**/*.test.js"];
|
||||||
|
|
||||||
|
let command = [mocha, ...mocha_options, ...mocha_files];
|
||||||
|
|
||||||
|
if (args.debug) {
|
||||||
|
command = ["node", "inspect", ...command];
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("spawning mocha...", command.join(" "));
|
||||||
|
|
||||||
|
const proc = spawn(command[0], command.slice(1), {
|
||||||
|
stdio: "inherit",
|
||||||
|
env: process.env,
|
||||||
|
});
|
||||||
|
|
||||||
|
proc.on("exit", function (code) {
|
||||||
|
if (args["test-report"]) {
|
||||||
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
process.exit(code);
|
||||||
|
}
|
||||||
|
});
|
@ -16,8 +16,7 @@
|
|||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true
|
||||||
"types": ["vitest/globals"]
|
|
||||||
},
|
},
|
||||||
"include": ["./src/back/*", "./src/back/**/*", "./src/back/routes/common/navbar.ts"],
|
"include": ["./src/back/*", "./src/back/**/*", "./src/back/routes/common/navbar.ts"],
|
||||||
"exclude": ["./src/front", "./src/**/*.stimulus.ts"],
|
"exclude": ["./src/front", "./src/**/*.stimulus.ts"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user