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: {
|
||||
mutate: jest
|
||||
.fn()
|
||||
.mockResolvedValueOnce({
|
||||
enable: 'u4711',
|
||||
})
|
||||
.mockResolvedValueOnce()
|
||||
.mockRejectedValue({
|
||||
message: 'Not Authorised!',
|
||||
}),
|
||||
@ -162,11 +160,13 @@ describe('DisableModal.vue', () => {
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('passes id to mutation', () => {
|
||||
it('passes parameters to mutation', () => {
|
||||
const calls = mocks.$apollo.mutate.mock.calls
|
||||
const [[{ variables }]] = calls
|
||||
expect(variables).toEqual({
|
||||
id: 'u4711',
|
||||
expect(variables).toMatchObject({
|
||||
resourceId: 'u4711',
|
||||
disable: true,
|
||||
closed: false,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ describe('ReleaseModal.vue', () => {
|
||||
$apollo: {
|
||||
mutate: jest
|
||||
.fn()
|
||||
.mockResolvedValueOnce({ enable: 'u4711' })
|
||||
.mockResolvedValueOnce()
|
||||
.mockRejectedValue({ message: 'Not Authorised!' }),
|
||||
},
|
||||
location: {
|
||||
@ -157,11 +157,13 @@ describe('ReleaseModal.vue', () => {
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('passes id to mutation', () => {
|
||||
it('passes parameters to mutation', () => {
|
||||
const calls = mocks.$apollo.mutate.mock.calls
|
||||
const [[{ variables }]] = calls
|
||||
expect(variables).toEqual({
|
||||
id: 'u4711',
|
||||
expect(variables).toMatchObject({
|
||||
resourceId: 'u4711',
|
||||
disable: false,
|
||||
closed: false,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -53,11 +53,13 @@ export default {
|
||||
// await this.modalData.buttons.confirm.callback()
|
||||
await this.$apollo.mutate({
|
||||
mutation: gql`
|
||||
mutation($id: ID!) {
|
||||
enable(id: $id)
|
||||
mutation($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
||||
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.isOpen = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user