mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Use of mutation enable removed, fix fronend tests
- The mutation definition still has to be removed.
This commit is contained in:
parent
a4521b4621
commit
d4e7e10f8c
@ -29,9 +29,7 @@ describe('DisableModal.vue', () => {
|
|||||||
$apollo: {
|
$apollo: {
|
||||||
mutate: jest
|
mutate: jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockResolvedValueOnce({
|
.mockResolvedValueOnce()
|
||||||
enable: 'u4711',
|
|
||||||
})
|
|
||||||
.mockRejectedValue({
|
.mockRejectedValue({
|
||||||
message: 'Not Authorised!',
|
message: 'Not Authorised!',
|
||||||
}),
|
}),
|
||||||
@ -162,11 +160,13 @@ describe('DisableModal.vue', () => {
|
|||||||
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('passes id to mutation', () => {
|
it('passes parameters to mutation', () => {
|
||||||
const calls = mocks.$apollo.mutate.mock.calls
|
const calls = mocks.$apollo.mutate.mock.calls
|
||||||
const [[{ variables }]] = calls
|
const [[{ variables }]] = calls
|
||||||
expect(variables).toEqual({
|
expect(variables).toMatchObject({
|
||||||
id: 'u4711',
|
resourceId: 'u4711',
|
||||||
|
disable: true,
|
||||||
|
closed: false,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ describe('ReleaseModal.vue', () => {
|
|||||||
$apollo: {
|
$apollo: {
|
||||||
mutate: jest
|
mutate: jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockResolvedValueOnce({ enable: 'u4711' })
|
.mockResolvedValueOnce()
|
||||||
.mockRejectedValue({ message: 'Not Authorised!' }),
|
.mockRejectedValue({ message: 'Not Authorised!' }),
|
||||||
},
|
},
|
||||||
location: {
|
location: {
|
||||||
@ -157,11 +157,13 @@ describe('ReleaseModal.vue', () => {
|
|||||||
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('passes id to mutation', () => {
|
it('passes parameters to mutation', () => {
|
||||||
const calls = mocks.$apollo.mutate.mock.calls
|
const calls = mocks.$apollo.mutate.mock.calls
|
||||||
const [[{ variables }]] = calls
|
const [[{ variables }]] = calls
|
||||||
expect(variables).toEqual({
|
expect(variables).toMatchObject({
|
||||||
id: 'u4711',
|
resourceId: 'u4711',
|
||||||
|
disable: false,
|
||||||
|
closed: false,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -53,11 +53,13 @@ export default {
|
|||||||
// await this.modalData.buttons.confirm.callback()
|
// await this.modalData.buttons.confirm.callback()
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($id: ID!) {
|
mutation($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
||||||
enable(id: $id)
|
decide(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
||||||
|
disable
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
variables: { id: this.id },
|
variables: { resourceId: this.id, disable: false, closed: false },
|
||||||
})
|
})
|
||||||
this.$toast.success(this.$t('release.success'))
|
this.$toast.success(this.$t('release.success'))
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user