From 5ccf7a8b31ccf014477a63110583061d1f8c9c5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:04:55 +0000 Subject: [PATCH 01/12] Bump typescript from 5.5.4 to 5.6.3 Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.4 to 5.6.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.5.4...v5.6.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f384bc75bf..b2e00fcfaa 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "sass": "^1.80.3", "tippy.js": "^6.3.7", "ts-loader": "^9.5.1", - "typescript": "^5.5.4", + "typescript": "^5.6.3", "webpack": "^5.95.0", "webpack-cli": "^5.1.4" }, diff --git a/yarn.lock b/yarn.lock index a7dccd8b97..72f849fe38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8117,10 +8117,10 @@ typescript-eslint@^8.10.0: "@typescript-eslint/parser" "8.10.0" "@typescript-eslint/utils" "8.10.0" -typescript@^5.5.4: - version "5.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" - integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== +typescript@^5.6.3: + version "5.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" + integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" From a58750b138994fd2b5ffe379ed2c0ecda372219b Mon Sep 17 00:00:00 2001 From: thvmulle Date: Tue, 22 Oct 2024 16:21:46 +0200 Subject: [PATCH 02/12] Added json-output for the questions endpoint using the annotation partial --- app/views/courses/questions.json.jbuilder | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/courses/questions.json.jbuilder b/app/views/courses/questions.json.jbuilder index b1d4a2de66..56efbedf11 100644 --- a/app/views/courses/questions.json.jbuilder +++ b/app/views/courses/questions.json.jbuilder @@ -1 +1,11 @@ -json.array! @questions +json.unanswered do + json.array! @unanswered, partial: 'annotations/annotation', as: :annotation +end + +json.in_progress do + json.array! @in_progress, partial: 'annotations/annotation', as: :annotation +end + +json.answered do + json.array! @answered, partial: 'annotations/annotation', as: :annotation +end From bd271334d4a2e268cf5e03046f32deca0a0584a5 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Wed, 23 Oct 2024 15:47:36 +0200 Subject: [PATCH 03/12] Fix typescript compilation for tests --- jest.config.js | 20 +-- package.json | 5 +- yarn.lock | 362 ++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 361 insertions(+), 26 deletions(-) diff --git a/jest.config.js b/jest.config.js index 48412c657a..7edca8fc93 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,20 +1,24 @@ module.exports = { preset: "ts-jest/presets/js-with-ts", reporters: ["default", "jest-junit"], - globals: { - "ts-jest": { - tsconfig: { - "allowJs": true, - "target": "es6", - }, - }, - }, setupFiles: ["/test/javascript/setup-jest.ts"], roots: ["test/javascript/", "app/assets/"], moduleDirectories: [ "node_modules", "app/assets/javascripts" ], + transform: { + '\\.tsx?$': [ + 'ts-jest', + { + tsconfig: { + "allowJs": true, + "target": "es6", + }, + } + ], + '\\.jsx?$': ['babel-jest', {plugins: ['@babel/plugin-transform-modules-commonjs']}] + }, transformIgnorePatterns: ["node_modules/?!(d3)"], collectCoverageFrom: ["app/assets/javascripts/**/*.{js,ts}"], }; diff --git a/package.json b/package.json index b2e00fcfaa..73f4bc7d0a 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,8 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "@webcomponents/scoped-custom-element-registry": "^0.0.9", + "babel-jest": "^29.7.0", + "babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-istanbul": "^7.0.0", "eslint": "^9.13.0", "eslint-config-google": "^0.14.0", @@ -88,5 +90,6 @@ "ts-jest": "^26.5.6", "typescript-eslint": "^8.10.0", "webpack-bundle-analyzer": "^4.10.2" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/yarn.lock b/yarn.lock index 72f849fe38..d8c721729e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,11 +23,24 @@ "@babel/highlight" "^7.25.7" picocolors "^1.0.0" +"@babel/code-frame@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.9.tgz#895b6c7e04a7271a0cbfd575d2e8131751914cc7" + integrity sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ== + dependencies: + "@babel/highlight" "^7.25.9" + picocolors "^1.0.0" + "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.7", "@babel/compat-data@^7.25.8": version "7.25.8" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.8.tgz#0376e83df5ab0eb0da18885c0140041f0747a402" integrity sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA== +"@babel/compat-data@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.9.tgz#24b01c5db6a3ebf85661b4fb4a946a9bccc72ac8" + integrity sha512-yD+hEuJ/+wAJ4Ox2/rpNv5HIuPG82x3ZlQvYVn8iYCprdxzE7P1udpGF1jyjQVBU4dgznN+k2h103vxZ7NdPyw== + "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.18.5", "@babel/core@^7.23.9", "@babel/core@^7.25.8", "@babel/core@^7.7.5": version "7.25.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.8.tgz#a57137d2a51bbcffcfaeba43cb4dd33ae3e0e1c6" @@ -49,6 +62,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.11.6": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.9.tgz#855a4cddcec4158f3f7afadacdab2a7de8af7434" + integrity sha512-WYvQviPw+Qyib0v92AwNIrdLISTp7RfDkM7bPqBvpbnhY4wq8HvHBZREVdYDXk98C8BkOIVnHAY3yvj7AVISxQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helpers" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/generator@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.7.tgz#de86acbeb975a3e11ee92dd52223e6b03b479c56" @@ -59,6 +93,16 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" +"@babel/generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.9.tgz#c7e828ebe0c2baba103b712924699c9e8a6e32f0" + integrity sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA== + dependencies: + "@babel/types" "^7.25.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -92,6 +136,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== + dependencies: + "@babel/compat-data" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.7.tgz#5d65074c76cae75607421c00d6bd517fe1892d6b" @@ -161,6 +216,14 @@ "@babel/traverse" "^7.25.7" "@babel/types" "^7.25.7" +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/helper-module-transforms@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz#2ac9372c5e001b19bc62f1fe7d96a18cb0901d1a" @@ -171,6 +234,16 @@ "@babel/helper-validator-identifier" "^7.25.7" "@babel/traverse" "^7.25.7" +"@babel/helper-module-transforms@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.9.tgz#12e4fb2969197ef6d78ea8a2f24375ce85b425fb" + integrity sha512-TvLZY/F3+GvdRYFZFyxMvnsKi+4oJdgZzU3BoGN9Uc2d9C6zfNwJcKKhjqLAhK8i46mv93jsO74fDh3ih6rpHA== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-simple-access" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/helper-optimise-call-expression@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.7.tgz#1de1b99688e987af723eed44fa7fc0ee7b97d77a" @@ -209,6 +282,14 @@ "@babel/traverse" "^7.25.7" "@babel/types" "^7.25.7" +"@babel/helper-simple-access@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" + integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.7.tgz#382831c91038b1a6d32643f5f49505b8442cb87c" @@ -222,16 +303,31 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz#d50e8d37b1176207b4fe9acedec386c565a44a54" integrity sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-validator-identifier@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz#77b7f60c40b15c97df735b38a66ba1d7c3e93da5" integrity sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + "@babel/helper-validator-option@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz#97d1d684448228b30b506d90cace495d6f492729" integrity sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ== +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== + "@babel/helper-wrap-function@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.25.7.tgz#9f6021dd1c4fdf4ad515c809967fc4bac9a70fe7" @@ -249,6 +345,14 @@ "@babel/template" "^7.25.7" "@babel/types" "^7.25.7" +"@babel/helpers@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.9.tgz#9e26aa6fbefdbca4f8c8a1d66dc6f1c00ddadb0a" + integrity sha512-oKWp3+usOJSzDZOucZUAMayhPz/xVjzymyDzUN8dk0Wd3RWMlGLXi07UCQ/CgQVb8LvXx3XBajJH4XGgkt7H7g== + dependencies: + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/highlight@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.7.tgz#20383b5f442aa606e7b5e3043b0b1aafe9f37de5" @@ -259,6 +363,16 @@ js-tokens "^4.0.0" picocolors "^1.0.0" +"@babel/highlight@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" + integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.25.7", "@babel/parser@^7.25.8": version "7.25.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.8.tgz#f6aaf38e80c36129460c1657c0762db584c9d5e2" @@ -266,6 +380,13 @@ dependencies: "@babel/types" "^7.25.8" +"@babel/parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.9.tgz#8fcaa079ac7458facfddc5cd705cc8005e4d3817" + integrity sha512-aI3jjAAO1fh7vY/pBGsn1i9LDbRP43+asrRlkPuTXW5yHXtd1NgTEMudbBoDDxrf1daEEfPJqR+JBMakzrR4Dg== + dependencies: + "@babel/types" "^7.25.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.7.tgz#93969ac50ef4d68b2504b01b758af714e4cbdd64" @@ -913,6 +1034,15 @@ "@babel/parser" "^7.25.7" "@babel/types" "^7.25.7" +"@babel/template@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + "@babel/traverse@^7.1.0", "@babel/traverse@^7.25.7": version "7.25.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.7.tgz#83e367619be1cab8e4f2892ef30ba04c26a40fa8" @@ -926,6 +1056,19 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" + integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.25.7", "@babel/types@^7.25.8", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.25.8" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.8.tgz#5cf6037258e8a9bcad533f4979025140cb9993e1" @@ -935,6 +1078,14 @@ "@babel/helper-validator-identifier" "^7.25.7" to-fast-properties "^2.0.0" +"@babel/types@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.9.tgz#620f35ea1f4233df529ec9a2668d2db26574deee" + integrity sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1553,6 +1704,13 @@ optionalDependencies: node-notifier "^8.0.0" +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + "@jest/source-map@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" @@ -1604,6 +1762,27 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + "@jest/types@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" @@ -1615,6 +1794,18 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -1661,18 +1852,18 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.20": - version "0.3.22" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" - integrity sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw== +"@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== +"@jridgewell/trace-mapping@^0.3.20": + version "0.3.22" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" + integrity sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -2142,6 +2333,11 @@ unplugin "1.0.1" uuid "^9.0.0" +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -2207,6 +2403,17 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" +"@types/babel__core@^7.1.14": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + "@types/babel__generator@*": version "7.6.4" resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" @@ -2468,6 +2675,13 @@ dependencies: "@types/node" "*" +"@types/graceful-fs@^4.1.3": + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== + dependencies: + "@types/node" "*" + "@types/iframe-resizer@^3.5.13": version "3.5.13" resolved "https://registry.yarnpkg.com/@types/iframe-resizer/-/iframe-resizer-3.5.13.tgz#b9bf74679d519a1a6afd3f1536b48d04e13a0aa7" @@ -2572,6 +2786,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^17.0.8": + version "17.0.33" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.33.tgz#8c32303da83eec050a84b3c7ae7b9f922d13e32d" + integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@8.10.0": version "8.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz#9c8218ed62f9a322df10ded7c34990f014df44f2" @@ -3132,6 +3353,19 @@ babel-jest@^26.6.3: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + babel-loader@^9.2.1: version "9.2.1" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.2.1.tgz#04c7835db16c246dd19ba0914418f3937797587b" @@ -3140,7 +3374,14 @@ babel-loader@^9.2.1: find-cache-dir "^4.0.0" schema-utils "^4.0.0" -babel-plugin-istanbul@^6.0.0: +babel-plugin-dynamic-import-node@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== + dependencies: + object.assign "^4.1.0" + +babel-plugin-istanbul@^6.0.0, babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== @@ -3172,6 +3413,16 @@ babel-plugin-jest-hoist@^26.6.2: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" @@ -3231,6 +3482,14 @@ babel-preset-jest@^26.6.2: babel-plugin-jest-hoist "^26.6.2" babel-preset-current-node-syntax "^1.0.0" +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -3386,7 +3645,7 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" -call-bind@^1.0.7: +call-bind@^1.0.5, call-bind@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== @@ -3493,6 +3752,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + cjs-module-lexer@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" @@ -4608,7 +4872,7 @@ fast-glob@^3.3.2: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -4796,7 +5060,7 @@ fscreen@^1.2.0: resolved "https://registry.yarnpkg.com/fscreen/-/fscreen-1.2.0.tgz#1a8c88e06bc16a07b473ad96196fb06d6657f59e" integrity sha512-hlq4+BU0hlPmwsFjwGGzZ+OZ9N/wq9Ljg/sq3pX+2CD7hrJsX9tJgWWK/wiNTFM212CLHWhicOoqwXyZGGetJg== -fsevents@^2.1.2, fsevents@~2.3.2: +fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -4967,7 +5231,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -5677,6 +5941,25 @@ jest-haste-map@^26.6.2: optionalDependencies: fsevents "^2.1.2" +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + jest-jasmine2@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" @@ -5772,6 +6055,11 @@ jest-regex-util@^26.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== + jest-resolve-dependencies@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" @@ -5896,6 +6184,18 @@ jest-util@^26.1.0, jest-util@^26.6.2: is-ci "^2.0.0" micromatch "^4.0.2" +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" @@ -5939,6 +6239,16 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== + dependencies: + "@types/node" "*" + jest-util "^29.7.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" @@ -6651,6 +6961,16 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + object.entries@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41" @@ -6867,7 +7187,7 @@ picocolors@^1.0.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -6877,7 +7197,7 @@ picomatch@^4.0.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== -pirates@^4.0.1: +pirates@^4.0.1, pirates@^4.0.4: version "4.0.6" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== @@ -7489,7 +7809,7 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -8262,7 +8582,7 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -walker@^1.0.7, walker@~1.0.5: +walker@^1.0.7, walker@^1.0.8, walker@~1.0.5: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -8460,6 +8780,14 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + write-file-atomic@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7" From ae9dfe928143186316b7ab477b3acd24ad967942 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 10:04:19 +0200 Subject: [PATCH 04/12] Added tests for the json format of questions --- test/controllers/courses_controller_test.rb | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index 0051a1f269..8993abe8ec 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -905,6 +905,68 @@ def with_users_signed_in(users) end end + test 'super admins are able to view questions in JSON format' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |who| + # Create some questions so we actually render something + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json + + assert_response :ok, "#{who} should be able to view questions in JSON format" + end + end + + test 'super admins get correct question info in JSON format' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |_who| + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json + + json_response = response.parsed_body + + assert json_response.key?('unanswered'), "The 'unanswered' key should be present in the JSON response" + assert json_response.key?('in_progress'), "The 'in_progress' key should be present in the JSON response" + assert json_response.key?('answered'), "The 'answered' key should be present in the JSON response" + + assert_equal 1, json_response['unanswered'].size, 'There should be 1 unanswered question in the JSON response' + assert_equal 1, json_response['in_progress'].size, 'There should be 1 in_progress question in the JSON response' + assert_equal 1, json_response['answered'].size, 'There should be 1 answered question in the JSON response' + end + end + + test 'super admins can view empty question lists' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |_who| + get questions_course_path(@course), as: :json + + assert_response :ok + + json_response = response.parsed_body + + assert_empty json_response['unanswered'], 'There should be 0 unanswered questions in the JSON response' + assert_empty json_response['in_progress'], 'There should be 0 in_progress questions in the JSON response' + assert_empty json_response['answered'], 'There should be 0 answered questions in the JSON response' + end + end + + test 'non admins cannot view questions in JSON format' do + add_not_admins + with_users_signed_in @not_admins do |who| + get questions_course_path(@course), as: :json + + assert :ok, "#{who} should not be able to view questions in JSON format" + end + end + test 'Icalendar link exports valid and correct ics file' do time1 = DateTime.now time2 = DateTime.now + 1.day + 1.hour + 1.second From e477c671cce6c31120987f2d2134046e2cd3b056 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Tue, 22 Oct 2024 16:21:46 +0200 Subject: [PATCH 05/12] Added json-output for the questions endpoint using the annotation partial --- app/views/courses/questions.json.jbuilder | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/courses/questions.json.jbuilder b/app/views/courses/questions.json.jbuilder index b1d4a2de66..56efbedf11 100644 --- a/app/views/courses/questions.json.jbuilder +++ b/app/views/courses/questions.json.jbuilder @@ -1 +1,11 @@ -json.array! @questions +json.unanswered do + json.array! @unanswered, partial: 'annotations/annotation', as: :annotation +end + +json.in_progress do + json.array! @in_progress, partial: 'annotations/annotation', as: :annotation +end + +json.answered do + json.array! @answered, partial: 'annotations/annotation', as: :annotation +end From bc3966f0cba0311980ac2cd85cd035bf3cb0e482 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 10:04:19 +0200 Subject: [PATCH 06/12] Added tests for the json format of questions --- test/controllers/courses_controller_test.rb | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index 0051a1f269..8993abe8ec 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -905,6 +905,68 @@ def with_users_signed_in(users) end end + test 'super admins are able to view questions in JSON format' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |who| + # Create some questions so we actually render something + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json + + assert_response :ok, "#{who} should be able to view questions in JSON format" + end + end + + test 'super admins get correct question info in JSON format' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |_who| + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json + + json_response = response.parsed_body + + assert json_response.key?('unanswered'), "The 'unanswered' key should be present in the JSON response" + assert json_response.key?('in_progress'), "The 'in_progress' key should be present in the JSON response" + assert json_response.key?('answered'), "The 'answered' key should be present in the JSON response" + + assert_equal 1, json_response['unanswered'].size, 'There should be 1 unanswered question in the JSON response' + assert_equal 1, json_response['in_progress'].size, 'There should be 1 in_progress question in the JSON response' + assert_equal 1, json_response['answered'].size, 'There should be 1 answered question in the JSON response' + end + end + + test 'super admins can view empty question lists' do + add_admins + super_admins = @admins.reject(&:student?) + with_users_signed_in super_admins do |_who| + get questions_course_path(@course), as: :json + + assert_response :ok + + json_response = response.parsed_body + + assert_empty json_response['unanswered'], 'There should be 0 unanswered questions in the JSON response' + assert_empty json_response['in_progress'], 'There should be 0 in_progress questions in the JSON response' + assert_empty json_response['answered'], 'There should be 0 answered questions in the JSON response' + end + end + + test 'non admins cannot view questions in JSON format' do + add_not_admins + with_users_signed_in @not_admins do |who| + get questions_course_path(@course), as: :json + + assert :ok, "#{who} should not be able to view questions in JSON format" + end + end + test 'Icalendar link exports valid and correct ics file' do time1 = DateTime.now time2 = DateTime.now + 1.day + 1.hour + 1.second From 77536fe44e8faf92a1066bf1b6ba992006512780 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 11:03:50 +0200 Subject: [PATCH 07/12] Delay the jobs to make sure the in_progress lists are not empty --- test/controllers/courses_controller_test.rb | 29 ++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index 8993abe8ec..dced3748e3 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -924,21 +924,26 @@ def with_users_signed_in(users) add_admins super_admins = @admins.reject(&:student?) with_users_signed_in super_admins do |_who| - submission = create :submission, course: @course - create :question, question_state: :answered, submission: submission - create :question, question_state: :unanswered, submission: submission - create :question, question_state: :in_progress, submission: submission - get questions_course_path(@course), as: :json - json_response = response.parsed_body + # without delayed jobs, in progress is automatically reset to unanswered + with_delayed_jobs do + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json - assert json_response.key?('unanswered'), "The 'unanswered' key should be present in the JSON response" - assert json_response.key?('in_progress'), "The 'in_progress' key should be present in the JSON response" - assert json_response.key?('answered'), "The 'answered' key should be present in the JSON response" + json_response = response.parsed_body - assert_equal 1, json_response['unanswered'].size, 'There should be 1 unanswered question in the JSON response' - assert_equal 1, json_response['in_progress'].size, 'There should be 1 in_progress question in the JSON response' - assert_equal 1, json_response['answered'].size, 'There should be 1 answered question in the JSON response' + assert json_response.key?('unanswered'), "The 'unanswered' key should be present in the JSON response" + assert json_response.key?('in_progress'), "The 'in_progress' key should be present in the JSON response" + assert json_response.key?('answered'), "The 'answered' key should be present in the JSON response" + + assert_equal 1, json_response['unanswered'].size, 'There should be 1 unanswered question in the JSON response' + assert_equal 1, json_response['in_progress'].size, 'There should be 1 in_progress question in the JSON response' + assert_equal 1, json_response['answered'].size, 'There should be 1 answered question in the JSON response' + end + run_delayed_jobs end end From e48443be3d3f8528d659c9a6c05f8e4df9e37274 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 11:09:23 +0200 Subject: [PATCH 08/12] Make rubocop happy by removing a newline --- test/controllers/courses_controller_test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index dced3748e3..5c7ae79608 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -924,7 +924,6 @@ def with_users_signed_in(users) add_admins super_admins = @admins.reject(&:student?) with_users_signed_in super_admins do |_who| - # without delayed jobs, in progress is automatically reset to unanswered with_delayed_jobs do submission = create :submission, course: @course From a8639e809631a8bbe4c71226525a0169fda0de77 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 12:02:56 +0200 Subject: [PATCH 09/12] Added the delayed jobs to the `super admins view JSON` and fixed assertion errors --- test/controllers/courses_controller_test.rb | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index 5c7ae79608..c7b3ce5b6f 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -909,14 +909,17 @@ def with_users_signed_in(users) add_admins super_admins = @admins.reject(&:student?) with_users_signed_in super_admins do |who| - # Create some questions so we actually render something - submission = create :submission, course: @course - create :question, question_state: :answered, submission: submission - create :question, question_state: :unanswered, submission: submission - create :question, question_state: :in_progress, submission: submission - get questions_course_path(@course), as: :json + # without delayed jobs, in progress is automatically reset to unanswered + with_delayed_jobs do + # Create some questions so we actually render something + submission = create :submission, course: @course + create :question, question_state: :answered, submission: submission + create :question, question_state: :unanswered, submission: submission + create :question, question_state: :in_progress, submission: submission + get questions_course_path(@course), as: :json - assert_response :ok, "#{who} should be able to view questions in JSON format" + assert_response :ok, "#{who} should be able to view questions in JSON format" + end end end @@ -967,7 +970,11 @@ def with_users_signed_in(users) with_users_signed_in @not_admins do |who| get questions_course_path(@course), as: :json - assert :ok, "#{who} should not be able to view questions in JSON format" + if who == 'not signed in' + assert_response :unauthorized, "#{who} should not be able to view questions in JSON format" + else + assert_response :forbidden, "#{who} should not be able to view questions in JSON format" + end end end From 8288aefe89beae6bc921a5594fe3fef138d0fea6 Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 13:27:24 +0200 Subject: [PATCH 10/12] Cleaner way to write response forbidden or unauthorized --- test/controllers/courses_controller_test.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index c7b3ce5b6f..132c5f04ea 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -970,11 +970,7 @@ def with_users_signed_in(users) with_users_signed_in @not_admins do |who| get questions_course_path(@course), as: :json - if who == 'not signed in' - assert_response :unauthorized, "#{who} should not be able to view questions in JSON format" - else - assert_response :forbidden, "#{who} should not be able to view questions in JSON format" - end + assert (response.forbidden? || response.unauthorized?), "#{who} should not be able to view questions in JSON format" end end From beede98f818d2b680342a037c95ec906151cef5b Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 13:39:12 +0200 Subject: [PATCH 11/12] Fix asserts with :ok --- test/controllers/courses_controller_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb index 132c5f04ea..54f2427b9f 100644 --- a/test/controllers/courses_controller_test.rb +++ b/test/controllers/courses_controller_test.rb @@ -874,7 +874,7 @@ def with_users_signed_in(users) create :question, question_state: :in_progress, submission: submission get questions_course_path(@course) - assert :ok, "#{who} should be able to view questions" + assert_response :ok, "#{who} should be able to view questions" end end @@ -883,7 +883,7 @@ def with_users_signed_in(users) with_users_signed_in @not_admins do |who| get questions_course_path(@course) - assert :ok, "#{who} should not be able to view questions" + assert_response :redirect, "#{who} should not be able to view questions" end end From 04299339d43e0aa9816b9cfd0ec1b2d89df7a01a Mon Sep 17 00:00:00 2001 From: thvmulle Date: Thu, 24 Oct 2024 13:52:02 +0200 Subject: [PATCH 12/12] Added empty list fallback if variables are not declared --- app/views/courses/questions.json.jbuilder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/courses/questions.json.jbuilder b/app/views/courses/questions.json.jbuilder index 56efbedf11..b9d59bc736 100644 --- a/app/views/courses/questions.json.jbuilder +++ b/app/views/courses/questions.json.jbuilder @@ -1,11 +1,11 @@ json.unanswered do - json.array! @unanswered, partial: 'annotations/annotation', as: :annotation + json.array! @unanswered || [], partial: 'annotations/annotation', as: :annotation end json.in_progress do - json.array! @in_progress, partial: 'annotations/annotation', as: :annotation + json.array! @in_progress || [], partial: 'annotations/annotation', as: :annotation end json.answered do - json.array! @answered, partial: 'annotations/annotation', as: :annotation + json.array! @answered || [], partial: 'annotations/annotation', as: :annotation end