mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Disable/enable should return the Resource
This commit is contained in:
parent
389f447186
commit
1377455cda
@ -37,7 +37,7 @@ afterEach(async () => {
|
||||
describe('disable', () => {
|
||||
const mutation = `
|
||||
mutation($id: ID!, $type: ResourceEnum!) {
|
||||
disable(resource: { id: $id, type: $type })
|
||||
disable(resource: { id: $id, type: $type }) { id type }
|
||||
}
|
||||
`
|
||||
let variables
|
||||
@ -103,8 +103,8 @@ describe('disable', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('returns true', async () => {
|
||||
const expected = { disable: true }
|
||||
it('returns disabled Resource', async () => {
|
||||
const expected = { disable: { id: 'c47', type: 'comment' } }
|
||||
await runSetup()
|
||||
await expect(action()).resolves.toEqual(expected)
|
||||
})
|
||||
@ -154,8 +154,8 @@ describe('disable', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('returns true', async () => {
|
||||
const expected = { disable: true }
|
||||
it('returns disabled Resource', async () => {
|
||||
const expected = { disable: { id: 'p9', type: 'contribution' } }
|
||||
await runSetup()
|
||||
await expect(action()).resolves.toEqual(expected)
|
||||
})
|
||||
@ -195,7 +195,7 @@ describe('disable', () => {
|
||||
describe('enable', () => {
|
||||
const mutation = `
|
||||
mutation($id: ID!, $type: ResourceEnum!) {
|
||||
enable(resource: { id: $id, type: $type })
|
||||
enable(resource: { id: $id, type: $type }) { id type }
|
||||
}
|
||||
`
|
||||
let variables
|
||||
@ -270,8 +270,8 @@ describe('enable', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('returns true', async () => {
|
||||
const expected = { enable: true }
|
||||
it('returns disabled Resource', async () => {
|
||||
const expected = { enable: { id: 'c456', type: 'comment' } }
|
||||
await runSetup()
|
||||
await expect(action()).resolves.toEqual(expected)
|
||||
})
|
||||
@ -331,8 +331,8 @@ describe('enable', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('returns true', async () => {
|
||||
const expected = { enable: true }
|
||||
it('returns disabled Resource', async () => {
|
||||
const expected = { enable: { id: 'p9', type: 'contribution' } }
|
||||
await runSetup()
|
||||
await expect(action()).resolves.toEqual(expected)
|
||||
})
|
||||
|
||||
@ -7,8 +7,8 @@ type Mutation {
|
||||
login(email: String!, password: String!): String!
|
||||
signup(email: String!, password: String!): Boolean!
|
||||
report(resource: Resource!, description: String): Report
|
||||
disable(resource: Resource!): Boolean!
|
||||
enable(resource: Resource!): Boolean!
|
||||
disable(resource: Resource!): ResourcePayload!
|
||||
enable(resource: Resource!): ResourcePayload!
|
||||
}
|
||||
|
||||
type Statistics {
|
||||
@ -32,6 +32,11 @@ input Resource {
|
||||
type: ResourceEnum!
|
||||
}
|
||||
|
||||
type ResourcePayload {
|
||||
id: ID!,
|
||||
type: ResourceEnum!
|
||||
}
|
||||
|
||||
enum ResourceEnum {
|
||||
contribution
|
||||
comment
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user