diff --git a/backend/package.json b/backend/package.json
index e7d00cee3..779a51185 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -76,8 +76,8 @@
"metascraper-soundcloud": "^5.9.5",
"metascraper-title": "^5.10.3",
"metascraper-url": "^5.10.3",
- "metascraper-video": "^5.9.5",
- "metascraper-youtube": "^5.9.5",
+ "metascraper-video": "^5.10.3",
+ "metascraper-youtube": "^5.10.3",
"minimatch": "^3.0.4",
"mustache": "^3.2.1",
"neo4j-driver": "^4.0.1",
diff --git a/backend/yarn.lock b/backend/yarn.lock
index af96816a1..3a1865129 100644
--- a/backend/yarn.lock
+++ b/backend/yarn.lock
@@ -6057,20 +6057,20 @@ metascraper-url@^5.10.3:
dependencies:
"@metascraper/helpers" "^5.10.3"
-metascraper-video@^5.9.5:
- version "5.9.5"
- resolved "https://registry.yarnpkg.com/metascraper-video/-/metascraper-video-5.9.5.tgz#707eb9726a96a64ecd8f234a7716c021ccf10f3f"
- integrity sha512-ApYCnVpEPy3+sLHxjMVXUVolHgdEOwpaiH41win4h5HmDX6jz/gWg3ENaHWfRLTn94Gc3c2Fjkqg/dwShRK0/A==
+metascraper-video@^5.10.3:
+ version "5.10.3"
+ resolved "https://registry.yarnpkg.com/metascraper-video/-/metascraper-video-5.10.3.tgz#deb0510b247aff0c9f1777a9d790f0aa55fa2890"
+ integrity sha512-xXGtPWX1RYSEOkLDvIzD20+o4hrSYycN31briMwQkjL7ZcuSfGgILDOCXSnT+WcpEbRNNxAOmODvAxU5qGnqjQ==
dependencies:
- "@metascraper/helpers" "^5.9.5"
+ "@metascraper/helpers" "^5.10.3"
lodash "~4.17.15"
-metascraper-youtube@^5.9.5:
- version "5.9.5"
- resolved "https://registry.yarnpkg.com/metascraper-youtube/-/metascraper-youtube-5.9.5.tgz#0d67c3619cfaf5434fe51bd3d18be6a6f1b31c7f"
- integrity sha512-xC6e6l08/qdqNp7rtyMWPumIh0tCqNhWJkL8F5BjMZCGA3iL2OYh82v26qH/H4GdMZlxSsglNJQTjl8ywcdEmw==
+metascraper-youtube@^5.10.3:
+ version "5.10.3"
+ resolved "https://registry.yarnpkg.com/metascraper-youtube/-/metascraper-youtube-5.10.3.tgz#58a121ae9b7aa8f244cbbfde66b57884390b9d64"
+ integrity sha512-mK+pPu3XJt6RqdoUKlXvlO9Lj2Tf+cfZwqCL1zLi8piYIyjbXDEx8VAb5Yz+GxDR57UWeFugnMtn/CpSbSDMNg==
dependencies:
- "@metascraper/helpers" "^5.9.5"
+ "@metascraper/helpers" "^5.10.3"
get-video-id "~3.1.4"
is-reachable "~4.0.0"
p-locate "~4.1.0"
diff --git a/webapp/components/CategoriesSelect/CategoriesSelect.spec.js b/webapp/components/CategoriesSelect/CategoriesSelect.spec.js
index b633e5811..82f5e61eb 100644
--- a/webapp/components/CategoriesSelect/CategoriesSelect.spec.js
+++ b/webapp/components/CategoriesSelect/CategoriesSelect.spec.js
@@ -1,5 +1,6 @@
import { mount } from '@vue/test-utils'
import CategoriesSelect from './CategoriesSelect'
+import Vue from 'vue'
const localVue = global.localVue
@@ -55,8 +56,9 @@ describe('CategoriesSelect.vue', () => {
})
describe('toggleCategory', () => {
- beforeEach(() => {
+ beforeEach(async () => {
wrapper.vm.categories = categories
+ await Vue.nextTick()
democracyAndPolitics = wrapper.findAll('button').at(0)
democracyAndPolitics.trigger('click')
})
diff --git a/webapp/components/CommentForm/CommentForm.spec.js b/webapp/components/CommentForm/CommentForm.spec.js
index 5dde84008..420ab26fb 100644
--- a/webapp/components/CommentForm/CommentForm.spec.js
+++ b/webapp/components/CommentForm/CommentForm.spec.js
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils'
import CommentForm from './CommentForm'
-
+import Vue from 'vue'
import MutationObserver from 'mutation-observer'
global.MutationObserver = MutationObserver
@@ -74,6 +74,7 @@ describe('CommentForm.vue', () => {
it('calls `clear` method when the cancel button is clicked', async () => {
wrapper.vm.updateEditorContent('ok')
+ await Vue.nextTick()
await wrapper.find('[data-test="cancel-button"]').trigger('submit')
expect(cancelMethodSpy).toHaveBeenCalledTimes(1)
})
diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js
index 7bcaa8212..b2ce7d530 100644
--- a/webapp/components/ContributionForm/ContributionForm.spec.js
+++ b/webapp/components/ContributionForm/ContributionForm.spec.js
@@ -1,6 +1,7 @@
import { config, mount } from '@vue/test-utils'
import ContributionForm from './ContributionForm.vue'
+import Vue from 'vue'
import Vuex from 'vuex'
import PostMutations from '~/graphql/PostMutations.js'
import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect'
@@ -147,31 +148,31 @@ describe('ContributionForm.vue', () => {
dataPrivacyButton.trigger('click')
})
- it('title should not be empty', async () => {
+ it('title cannot be empty', async () => {
postTitleInput.setValue('')
wrapper.find('form').trigger('submit')
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- it('title should not be too long', async () => {
+ it('title cannot be too long', async () => {
postTitleInput.setValue(postTitleTooLong)
wrapper.find('form').trigger('submit')
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- it('title should not be too short', async () => {
+ it('title cannot be too short', async () => {
postTitleInput.setValue(postTitleTooShort)
wrapper.find('form').trigger('submit')
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- it('content should not be empty', async () => {
+ it('content cannot be empty', async () => {
await wrapper.vm.updateEditorContent('')
await wrapper.find('form').trigger('submit')
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- it('should have at least one category', async () => {
+ it('has at least one category', async () => {
dataPrivacyButton = await wrapper
.find(CategoriesSelect)
.find('[data-test="category-buttons-cat12"]')
@@ -180,8 +181,9 @@ describe('ContributionForm.vue', () => {
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- it('should have not have more than three categories', async () => {
+ it('has no more than three categories', async () => {
wrapper.vm.form.categoryIds = ['cat4', 'cat9', 'cat15', 'cat27']
+ await Vue.nextTick()
wrapper.find('form').trigger('submit')
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
@@ -209,10 +211,12 @@ describe('ContributionForm.vue', () => {
wrapper.find(CategoriesSelect).setData({ categories })
englishLanguage = wrapper.findAll('li').filter(language => language.text() === 'English')
englishLanguage.trigger('click')
+ await Vue.nextTick()
dataPrivacyButton = await wrapper
.find(CategoriesSelect)
.find('[data-test="category-buttons-cat12"]')
dataPrivacyButton.trigger('click')
+ await Vue.nextTick()
})
it('creates a post with valid title, content, and at least one category', async () => {
@@ -278,10 +282,12 @@ describe('ContributionForm.vue', () => {
wrapper.find(CategoriesSelect).setData({ categories })
englishLanguage = wrapper.findAll('li').filter(language => language.text() === 'English')
englishLanguage.trigger('click')
+ await Vue.nextTick()
dataPrivacyButton = await wrapper
.find(CategoriesSelect)
.find('[data-test="category-buttons-cat12"]')
dataPrivacyButton.trigger('click')
+ await Vue.nextTick()
})
it('shows an error toaster when apollo mutation rejects', async () => {
@@ -370,6 +376,7 @@ describe('ContributionForm.vue', () => {
it('supports updating categories', async () => {
expectedParams.variables.categoryIds.push('cat3')
wrapper.find(CategoriesSelect).setData({ categories })
+ await Vue.nextTick()
const healthWellbeingButton = await wrapper
.find(CategoriesSelect)
.find('[data-test="category-buttons-cat3"]')
diff --git a/webapp/components/DeleteData/DeleteData.spec.js b/webapp/components/DeleteData/DeleteData.spec.js
index 484fd5492..3529c1b7b 100644
--- a/webapp/components/DeleteData/DeleteData.spec.js
+++ b/webapp/components/DeleteData/DeleteData.spec.js
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils'
import DeleteData from './DeleteData.vue'
-
+import Vue from 'vue'
import Vuex from 'vuex'
const localVue = global.localVue
@@ -168,6 +168,7 @@ describe('DeleteData.vue', () => {
it('shows an error toaster when the mutation rejects', async () => {
enableDeletionInput = wrapper.find('.enable-deletion-input input')
enableDeletionInput.setValue(deleteAccountName)
+ await Vue.nextTick()
deleteAccountBtn = wrapper.find('[data-test="delete-button"]')
await deleteAccountBtn.trigger('click')
// second submission causes mutation to reject
diff --git a/webapp/components/MasonryGrid/MasonryGrid.spec.js b/webapp/components/MasonryGrid/MasonryGrid.spec.js
index b42b9b221..00e7859d8 100644
--- a/webapp/components/MasonryGrid/MasonryGrid.spec.js
+++ b/webapp/components/MasonryGrid/MasonryGrid.spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
-
+import Vue from 'vue'
import MasonryGrid from './MasonryGrid'
const localVue = global.localVue
@@ -13,29 +13,29 @@ describe('MasonryGrid', () => {
masonryGridItem = wrapper.vm.$children[0]
})
- it('adds the "reset-grid-height" class when itemsCalculating is more than 0', () => {
+ it('adds the "reset-grid-height" class when itemsCalculating is more than 0', async () => {
wrapper.setData({ itemsCalculating: 1 })
-
+ await Vue.nextTick()
expect(wrapper.classes()).toContain('reset-grid-height')
})
- it('removes the "reset-grid-height" class when itemsCalculating is 0', () => {
+ it('removes the "reset-grid-height" class when itemsCalculating is 0', async () => {
wrapper.setData({ itemsCalculating: 0 })
-
+ await Vue.nextTick()
expect(wrapper.classes()).not.toContain('reset-grid-height')
})
- it('adds 1 to itemsCalculating when a child emits "calculating-item-height"', () => {
+ it('adds 1 to itemsCalculating when a child emits "calculating-item-height"', async () => {
wrapper.setData({ itemsCalculating: 0 })
masonryGridItem.$emit('calculating-item-height')
-
+ await Vue.nextTick()
expect(wrapper.vm.itemsCalculating).toBe(1)
})
- it('subtracts 1 from itemsCalculating when a child emits "finished-calculating-item-height"', () => {
+ it('subtracts 1 from itemsCalculating when a child emits "finished-calculating-item-height"', async () => {
wrapper.setData({ itemsCalculating: 2 })
masonryGridItem.$emit('finished-calculating-item-height')
-
+ await Vue.nextTick()
expect(wrapper.vm.itemsCalculating).toBe(1)
})
})
diff --git a/webapp/components/Modal.spec.js b/webapp/components/Modal.spec.js
index 2dae4285a..c309d5684 100644
--- a/webapp/components/Modal.spec.js
+++ b/webapp/components/Modal.spec.js
@@ -5,6 +5,7 @@ import DisableModal from './Modal/DisableModal.vue'
import ReportModal from './Modal/ReportModal.vue'
import Vuex from 'vuex'
import { getters, mutations } from '../store/modal'
+import Vue from 'vue'
const localVue = global.localVue
@@ -89,8 +90,9 @@ describe('Modal.vue', () => {
})
describe('child component emits close', () => {
- it('turns empty', () => {
+ it('turns empty', async () => {
wrapper.find(DisableModal).vm.$emit('close')
+ await Vue.nextTick()
expect(wrapper.contains(DisableModal)).toBe(false)
})
})
diff --git a/webapp/components/Modal/ReportModal.spec.js b/webapp/components/Modal/ReportModal.spec.js
index b151f3c7b..de95cce99 100644
--- a/webapp/components/Modal/ReportModal.spec.js
+++ b/webapp/components/Modal/ReportModal.spec.js
@@ -1,5 +1,6 @@
import { config, shallowMount, mount } from '@vue/test-utils'
import ReportModal from './ReportModal.vue'
+import Vue from 'vue'
const localVue = global.localVue
@@ -151,9 +152,11 @@ describe('ReportModal.vue', () => {
})
describe('click confirm button', () => {
- beforeEach(() => {
+ beforeEach(async () => {
wrapper.find('.ds-radio-option-label').trigger('click')
+ await Vue.nextTick()
wrapper.find('button.confirm').trigger('click')
+ await Vue.nextTick()
})
it('calls report mutation', () => {
diff --git a/webapp/components/Registration/CreateUserAccount.spec.js b/webapp/components/Registration/CreateUserAccount.spec.js
index 8d1f1617d..faa9319e7 100644
--- a/webapp/components/Registration/CreateUserAccount.spec.js
+++ b/webapp/components/Registration/CreateUserAccount.spec.js
@@ -1,8 +1,8 @@
import { config, mount } from '@vue/test-utils'
+import Vue from 'vue'
import { VERSION } from '~/constants/terms-and-conditions-version.js'
import CreateUserAccount from './CreateUserAccount'
import { SignupVerificationMutation } from '~/graphql/Registration.js'
-
const localVue = global.localVue
config.stubs['sweetalert-icon'] = '