diff --git a/src/views/invites/index.vue b/src/views/invites/index.vue index 2497bfc0..66c9d49b 100644 --- a/src/views/invites/index.vue +++ b/src/views/invites/index.vue @@ -39,7 +39,7 @@ - {{ $t('invites.cancel') }} + {{ $t('invites.cancel') }} {{ $t('invites.create') }} diff --git a/test/views/invites/index.test.js b/test/views/invites/index.test.js index c4a1b4ef..6789a3a8 100644 --- a/test/views/invites/index.test.js +++ b/test/views/invites/index.test.js @@ -44,19 +44,18 @@ describe('Invite tokens', () => { }) await flushPromises() - const dialog = wrapper.find('div.el-dialog__wrapper .create-new-token-dialog') - expect(dialog.isVisible()).toBe(false) - + wrapper.setData({ createTokenDialogVisible: false }) const openDialogButton = wrapper.find('button.create-invite-token') - const closeDialogButton = wrapper.find('div.el-dialog__footer button') + const closeDialogButton = wrapper.find('div.el-dialog__footer button.invites-close-dialog') + expect(wrapper.vm.createTokenDialogVisible).toBe(false) openDialogButton.trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(true) + expect(wrapper.vm.createTokenDialogVisible).toBe(true) closeDialogButton.trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(false) + expect(wrapper.vm.createTokenDialogVisible).toBe(false) done() }) diff --git a/test/views/users/index.test.js b/test/views/users/index.test.js index 63473aaf..00004214 100644 --- a/test/views/users/index.test.js +++ b/test/views/users/index.test.js @@ -239,21 +239,21 @@ describe('Users actions', () => { }) await flushPromises() - const dialog = wrapper.find('.password-reset-token-dialog') + wrapper.setData({ resetPasswordDialogOpen: false }) const closeDialogButton = wrapper.find('.password-reset-token-dialog button') - expect(dialog.isVisible()).toBe(false) + expect(wrapper.vm.resetPasswordDialogOpen).toBe(false) expect(store.state.users.passwordResetToken.token).toBe('') wrapper.find(htmlElement(1, 11)).trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(true) + expect(wrapper.vm.resetPasswordDialogOpen).toBe(true) expect(store.state.users.passwordResetToken.token).toBe('g05lxnBJQnL') expect(store.state.users.passwordResetToken.link).toBe('http://url/api/pleroma/password_reset/g05lxnBJQnL') closeDialogButton.trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(false) + expect(wrapper.vm.resetPasswordDialogOpen).toBe(false) done() }) }) @@ -278,19 +278,18 @@ describe('Creates new account', () => { }) await flushPromises() - const dialog = wrapper.find('div.el-dialog__wrapper') - expect(dialog.isVisible()).toBe(false) - + wrapper.setData({ createAccountDialogOpen: false }) const openDialogButton = wrapper.find('button.actions-button') const closeDialogButton = wrapper.find('div.el-dialog__footer button') + expect(wrapper.vm.createAccountDialogOpen).toBe(false) openDialogButton.trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(true) + expect(wrapper.vm.createAccountDialogOpen).toBe(true) closeDialogButton.trigger('click') await flushPromises() - expect(dialog.isVisible()).toBe(false) + expect(wrapper.vm.createAccountDialogOpen).toBe(false) done() }) diff --git a/yarn.lock b/yarn.lock index 3940d725..9f9b284d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1012,13 +1012,14 @@ source-map "~0.6.1" vue-template-es2015-compiler "^1.9.0" -"@vue/test-utils@1.0.0-beta.29": - version "1.0.0-beta.29" - resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.29.tgz#c942cf25e891cf081b6a03332b4ae1ef430726f0" - integrity sha512-yX4sxEIHh4M9yAbLA/ikpEnGKMNBCnoX98xE1RwxfhQVcn0MaXNSj1Qmac+ZydTj6VBSEVukchBogXBTwc+9iA== +"@vue/test-utils@^1.0.0-beta.29": + version "1.0.0-beta.32" + resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.32.tgz#38c3947886236201a3f24b583c73598eb95ccc69" + integrity sha512-ywhe7PATMAk/ZGdsrcuQIliQusOyfe0OOHjKKCCERqgHh1g/kqPtmSMT5Jx4sErx53SYbNucr8QOK6/u5ianAw== dependencies: dom-event-types "^1.0.0" - lodash "^4.17.4" + lodash "^4.17.15" + pretty "^2.0.0" "@webassemblyjs/ast@1.8.5": version "1.8.5" @@ -2496,6 +2497,11 @@ commander@^2.13.0, commander@^2.14.1, commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== +commander@^2.19.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -2568,6 +2574,23 @@ concat-stream@^1.5.0, concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +condense-newlines@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f" + integrity sha1-PemFVTE5R10yUCyDsC9gaE0kxV8= + dependencies: + extend-shallow "^2.0.1" + is-whitespace "^0.3.0" + kind-of "^3.0.2" + +config-chain@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== + dependencies: + ini "^1.3.4" + proto-list "~1.2.1" + connect-history-api-fallback@^1.3.0: version "1.6.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" @@ -3431,6 +3454,16 @@ echarts@4.1.0: dependencies: zrender "4.0.4" +editorconfig@^0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" + integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g== + dependencies: + commander "^2.19.0" + lru-cache "^4.1.5" + semver "^5.6.0" + sigmund "^1.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -5306,6 +5339,11 @@ is-utf8@^0.2.0: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= +is-whitespace@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-whitespace/-/is-whitespace-0.3.0.tgz#1639ecb1be036aec69a54cbb401cfbed7114ab7f" + integrity sha1-Fjnssb4DauxppUy7QBz77XEUq38= + is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -5793,6 +5831,17 @@ js-base64@^2.1.8, js-base64@^2.1.9: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw== +js-beautify@^1.6.12: + version "1.10.3" + resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.10.3.tgz#c73fa10cf69d3dfa52d8ed624f23c64c0a6a94c1" + integrity sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ== + dependencies: + config-chain "^1.1.12" + editorconfig "^0.15.3" + glob "^7.1.3" + mkdirp "~0.5.1" + nopt "~4.0.1" + js-cookie@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.0.tgz#1b2c279a6eece380a12168b92485265b35b1effb" @@ -6235,6 +6284,11 @@ lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.3, lodash@^4.17.4, resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -6291,7 +6345,7 @@ lower-case@^1.1.1: resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= -lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2: +lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.5: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -6948,6 +7002,14 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" +nopt@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48" + integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== + dependencies: + abbrev "1" + osenv "^0.1.4" + normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -8051,6 +8113,15 @@ pretty-format@^24.3.0: ansi-regex "^4.0.0" ansi-styles "^3.2.0" +pretty@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pretty/-/pretty-2.0.0.tgz#adbc7960b7bbfe289a557dc5f737619a220d06a5" + integrity sha1-rbx5YLe7/iiaVX3F9zdhmiINBqU= + dependencies: + condense-newlines "^0.2.1" + extend-shallow "^2.0.1" + js-beautify "^1.6.12" + printj@~1.1.0, printj@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" @@ -8094,6 +8165,11 @@ prompts@^2.0.1: kleur "^3.0.2" sisteransi "^1.0.0" +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= + proxy-addr@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" @@ -8973,6 +9049,11 @@ showdown@1.8.6: dependencies: yargs "^10.0.3" +sigmund@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"