mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix vue warning webapp, try to find source of cypress failure
- clean up
This commit is contained in:
parent
973912fb87
commit
8b27250393
@ -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',
|
||||
|
||||
@ -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`, () => {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -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'))
|
||||
|
||||
@ -44,6 +44,9 @@ describe('PostSlug', () => {
|
||||
$apollo: {
|
||||
mutate: jest.fn().mockResolvedValue(),
|
||||
},
|
||||
$route: {
|
||||
hash: '',
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -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'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user