diff --git a/package-lock.json b/package-lock.json index 02064dd4fd..03c8254377 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9691,9 +9691,9 @@ } }, "mongodb": { - "version": "3.5.6", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.5.6.tgz", - "integrity": "sha512-sh3q3GLDLT4QmoDLamxtAECwC3RGjq+oNuK1ENV8+tnipIavss6sMYt77hpygqlMOCt0Sla5cl7H4SKCVBCGEg==", + "version": "3.5.7", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.5.7.tgz", + "integrity": "sha512-lMtleRT+vIgY/JhhTn1nyGwnSMmJkJELp+4ZbrjctrnBxuLbj6rmLuJFz8W2xUzUqWmqoyVxJLYuC58ZKpcTYQ==", "dev": true, "requires": { "bl": "^2.2.0", @@ -9713,19 +9713,13 @@ "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" } - }, - "bson": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.4.tgz", - "integrity": "sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q==", - "dev": true } } }, "mongoose": { - "version": "5.9.13", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.9.13.tgz", - "integrity": "sha512-MsFdJAaCTVbDA3gYskUEpUN1kThL7sp4zh8N9rGt0+9vYMn28q92NLK90vGssM9qjOGWp8HqLeT1fBgfMZDnKA==", + "version": "5.9.14", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.9.14.tgz", + "integrity": "sha512-LScxCruQv0YpU/9DasKdThd+3r3PFQbCgesmfa6g0pTDOIiD1A9N9OQsGYrDf+dyUksfLCxJYYF9qpBHLvS1tg==", "requires": { "bson": "^1.1.4", "kareem": "2.3.1", @@ -9770,9 +9764,9 @@ "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" }, "monk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/monk/-/monk-7.2.0.tgz", - "integrity": "sha512-PdCTlPhmUH5ULg80CS0Dgn9LQ7omldNQg+kVn7wtQF1cA/me/Kd5YmiRDxUeTUukpNFkrM3qEYP5oC5AqVjSgw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/monk/-/monk-7.3.0.tgz", + "integrity": "sha512-WqyCLjz32Q3OybOT+fleYHRz5DuG5/E0XKWvrmlHt0vPzTrNZ/BRQ+f2vzWi4apethuvblGTKsOtuDciM018dQ==", "dev": true, "requires": { "debug": "*", diff --git a/package.json b/package.json index 1c28ec0c62..a12abed953 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "method-override": "^3.0.0", "moment": "^2.25.3", "moment-recur": "^1.0.7", - "mongoose": "^5.9.13", + "mongoose": "^5.9.14", "morgan": "^1.10.0", "nconf": "^0.10.0", "node-gcm": "^1.0.2", @@ -112,7 +112,7 @@ "expect.js": "^0.3.1", "istanbul": "^1.1.0-alpha.1", "mocha": "^5.1.1", - "monk": "^7.2.0", + "monk": "^7.3.0", "require-again": "^2.0.0", "sinon": "^7.2.4", "sinon-chai": "^3.5.0", diff --git a/test/api/unit/libs/highlightMentions.test.js b/test/api/unit/libs/highlightMentions.test.js index e00e23950b..bd3955162e 100644 --- a/test/api/unit/libs/highlightMentions.test.js +++ b/test/api/unit/libs/highlightMentions.test.js @@ -100,6 +100,13 @@ describe('highlightMentions', () => { const result = await highlightMentions(text); expect(result[0]).to.equal('http://www.medium.com/@user/blog [@user](/profile/111)'); }); + + // https://github.com/HabitRPG/habitica/issues/12217 + it('doesn\'t highlight user in link with url-escapable characters', async () => { + const text = '[test](https://habitica.fandom.com/ru/@wiki/Снаряжение)'; + const result = await highlightMentions(text); + expect(result[0]).to.equal(text); + }); }); describe('exceptions in code blocks', () => { @@ -142,6 +149,14 @@ describe('highlightMentions', () => { expect(result[0]).to.equal('[@user](/profile/111) `@user`'); }); + + it('matches a link in between two the same links', async () => { + const text = '[here](http://habitica.wikia.com/wiki/The_Keep:Pirate_Cove/FAQ)\n@user\n[hier](http://habitica.wikia.com/wiki/The_Keep:Pirate_Cove/FAQ)'; + + const result = await highlightMentions(text); + + expect(result[0]).to.equal('[here](http://habitica.wikia.com/wiki/The_Keep:Pirate_Cove/FAQ)\n[@user](/profile/111)\n[hier](http://habitica.wikia.com/wiki/The_Keep:Pirate_Cove/FAQ)'); + }); }); it('github issue 12118, method crashes when square brackets are used', async () => { diff --git a/test/common/ops/buy/buyMysterySet.js b/test/common/ops/buy/buyMysterySet.js index 6db89cf998..6a7a0650a3 100644 --- a/test/common/ops/buy/buyMysterySet.js +++ b/test/common/ops/buy/buyMysterySet.js @@ -88,7 +88,14 @@ describe('shared.ops.buyMysterySet', () => { expect(user.items.gear.owned).to.have.property('armor_mystery_301404', true); expect(user.items.gear.owned).to.have.property('head_mystery_301404', true); expect(user.items.gear.owned).to.have.property('eyewear_mystery_301404', true); - expect(analytics.track).to.be.called; + expect(analytics.track).to.be.calledOnce; + expect(analytics.track).to.be.calledWithMatch('acquire item', { + uuid: user._id, + itemKey: '301404', + itemType: 'Subscriber Gear', + acquireMethod: 'Hourglass', + category: 'behavior', + }); }); }); }); diff --git a/website/client/package-lock.json b/website/client/package-lock.json index 0e8a86ab05..11f91bab23 100644 --- a/website/client/package-lock.json +++ b/website/client/package-lock.json @@ -7265,9 +7265,9 @@ "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" }, "bootstrap-vue": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.13.1.tgz", - "integrity": "sha512-FF1GLRvvj+TgpLkMG/A8+tCMQfWnfKpsPqt7s097VTX2lZv2/YmyhehRC1qraPHYqT7qQVy48TCxSw1H8hNh3Q==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.14.0.tgz", + "integrity": "sha512-sqbS7iHYCZEj/dDx4Yaze99HcX6bZjO4bSWZ0xSgJwtWQlbfB2VDJ9Qjzjp9XI8TT32wYNGAMpnXpYjQvv5qyQ==", "requires": { "@nuxt/opencollective": "^0.3.0", "bootstrap": ">=4.4.1 <5.0.0", @@ -17795,9 +17795,9 @@ } }, "sortablejs": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.1.tgz", - "integrity": "sha512-N6r7GrVmO8RW1rn0cTdvK3JR0BcqecAJ0PmYMCL3ZuqTH3pY+9QyqkmJSkkLyyDvd+AJnwaxTP22Ybr/83V9hQ==" + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz", + "integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A==" }, "source-list-map": { "version": "2.0.1", diff --git a/website/client/package.json b/website/client/package.json index e4fac93089..584c606fba 100644 --- a/website/client/package.json +++ b/website/client/package.json @@ -13,23 +13,23 @@ "test:unit": "vue-cli-service test:unit --require ./tests/unit/helpers.js" }, "dependencies": { - "@vue/cli-plugin-babel": "^4.3.1", - "@vue/cli-plugin-eslint": "^4.3.1", - "@vue/cli-plugin-router": "^4.3.1", - "@vue/cli-plugin-unit-mocha": "^4.3.1", - "@vue/cli-service": "^4.3.1", "@storybook/addon-actions": "^5.3.18", "@storybook/addon-knobs": "^5.3.18", "@storybook/addon-links": "^5.3.18", "@storybook/addon-notes": "^5.3.18", "@storybook/vue": "^5.3.18", + "@vue/cli-plugin-babel": "^4.3.1", + "@vue/cli-plugin-eslint": "^4.3.1", + "@vue/cli-plugin-router": "^4.3.1", + "@vue/cli-plugin-unit-mocha": "^4.3.1", + "@vue/cli-service": "^4.3.1", "@vue/test-utils": "1.0.0-beta.29", "amplitude-js": "^5.11.0", "axios": "^0.19.2", "axios-progress-bar": "^1.2.0", "babel-eslint": "^10.1.0", "bootstrap": "^4.4.1", - "bootstrap-vue": "^2.13.1", + "bootstrap-vue": "^2.14.0", "chai": "^4.1.2", "core-js": "^3.6.5", "eslint": "^6.8.0", @@ -58,7 +58,7 @@ "vue-mugen-scroll": "^0.2.6", "vue-router": "^3.1.6", "vue-template-compiler": "^2.6.11", - "vuedraggable": "^2.23.1", + "vuedraggable": "^2.23.2", "vuejs-datepicker": "git://github.com/habitrpg/vuejs-datepicker.git#5d237615463a84a23dd6f3f77c6ab577d68593ec", "webpack": "^4.43.0" } diff --git a/website/client/src/components/shops/buyModal.vue b/website/client/src/components/shops/buyModal.vue index 9013f9bc73..452ce3a533 100644 --- a/website/client/src/components/shops/buyModal.vue +++ b/website/client/src/components/shops/buyModal.vue @@ -377,8 +377,10 @@