Fix vue warning webapp, try to find source of cypress failure

- clean up
This commit is contained in:
mattwr18 2019-10-17 22:44:44 +02:00
parent 973912fb87
commit 8b27250393
6 changed files with 19 additions and 26 deletions

View File

@ -888,7 +888,7 @@ describe('UpdatePost', () => {
describe('admin can unpin posts', () => {
let admin, pinnedPost
beforeEach(async () => {
pinnedPost = await neode.create('Post', { id: 'post-to-be-unpinned' })
pinnedPost = await factory.create('Post', { id: 'post-to-be-unpinned' })
admin = await user.update({
role: 'admin',
name: 'Admin',

View File

@ -67,13 +67,11 @@ When('I click on the author', () => {
})
When('I report the author', () => {
cy.get('.page-name-profile-id-slug').then(() => {
invokeReportOnElement('.ds-card').then(() => {
cy.get('button')
.contains('Send')
.click()
})
})
cy.get('.page-name-profile-id-slug')
invokeReportOnElement('.ds-card')
cy.get('button')
.contains('Send')
.click()
})
When('I click on send in the confirmation dialog', () => {
@ -87,11 +85,10 @@ Then('I get a success message', () => {
})
Then('I see my reported user', () => {
cy.get('table').then(() => {
cy.get('tbody tr')
.first()
.contains(lastReportTitle.trim())
})
cy.get('table')
cy.get('tbody tr')
.first()
.contains(lastReportTitle.trim())
})
Then(`I can't see the moderation menu item`, () => {

View File

@ -36,15 +36,8 @@ const authenticatedHeaders = async (variables) => {
}
Cypress.Commands.add("switchLanguage", (name, force) => {
const { code } = helpers.getLangByName(name);
if (force) {
switchLang(name);
} else {
cy.get("html").then($html => {
if ($html && $html.attr("lang") !== code) {
switchLang(name);
}
});
}
});

View File

@ -178,7 +178,7 @@ export default {
this.$apollo
.mutate({
mutation: PostMutations().pinPost,
variables: { id: post.id, title: post.title, content: post.content, pinned: true },
variables: { id: post.id },
})
.then(() => {
this.$toast.success(this.$t('post.menu.pinnedSuccessfully'))
@ -191,7 +191,7 @@ export default {
this.$apollo
.mutate({
mutation: PostMutations().unpinPost,
variables: { id: post.id, title: post.title, content: post.content, unpinned: true },
variables: { id: post.id },
})
.then(() => {
this.$toast.success(this.$t('post.menu.unpinnedSuccessfully'))

View File

@ -44,6 +44,9 @@ describe('PostSlug', () => {
$apollo: {
mutate: jest.fn().mockResolvedValue(),
},
$route: {
hash: '',
},
}
})

View File

@ -171,8 +171,8 @@ export default {
pinPost(post) {
this.$apollo
.mutate({
mutation: PostMutations().UpdatePost,
variables: { id: post.id, title: post.title, content: post.content, pinned: true },
mutation: PostMutations().pinPost,
variables: { id: post.id },
})
.then(() => {
this.$toast.success(this.$t('post.menu.pinnedSuccessfully'))
@ -182,8 +182,8 @@ export default {
unpinPost(post) {
this.$apollo
.mutate({
mutation: PostMutations().UpdatePost,
variables: { id: post.id, title: post.title, content: post.content, unpinned: true },
mutation: PostMutations().unpinPost,
variables: { id: post.id },
})
.then(() => {
this.$toast.success(this.$t('post.menu.unpinnedSuccessfully'))