mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
More of @mattwr18's suggestions
This commit is contained in:
parent
bb3f419532
commit
672f19e6d1
@ -344,7 +344,7 @@ describe('UpdatePost', () => {
|
||||
it('allows a maximum of three category for a successful update', async () => {
|
||||
const {
|
||||
errors: [error],
|
||||
} = await mutate({ mutation: createPostMutation, variables })
|
||||
} = await mutate({ mutation: updatePostMutation, variables })
|
||||
expect(error).toHaveProperty(
|
||||
'message',
|
||||
'You cannot save a post without at least one category or more than three',
|
||||
@ -375,7 +375,7 @@ describe('UpdatePost', () => {
|
||||
const {
|
||||
errors: [error],
|
||||
} = await mutate({
|
||||
mutation: createPostMutation,
|
||||
mutation: updatePostMutation,
|
||||
variables: {
|
||||
...variables,
|
||||
categoryIds: null,
|
||||
@ -391,7 +391,7 @@ describe('UpdatePost', () => {
|
||||
const {
|
||||
errors: [error],
|
||||
} = await mutate({
|
||||
mutation: createPostMutation,
|
||||
mutation: updatePostMutation,
|
||||
variables: {
|
||||
...variables,
|
||||
categoryIds: [],
|
||||
|
||||
@ -57,12 +57,11 @@ describe('User', () => {
|
||||
|
||||
describe('as admin', () => {
|
||||
beforeEach(async () => {
|
||||
const userParams = {
|
||||
const admin = await factory.create('User', {
|
||||
role: 'admin',
|
||||
email: 'admin@example.org',
|
||||
password: '1234',
|
||||
}
|
||||
const admin = await factory.create('User', userParams)
|
||||
})
|
||||
authenticatedUser = await admin.toJson()
|
||||
})
|
||||
|
||||
@ -203,7 +202,7 @@ describe('DeleteUser', () => {
|
||||
await factory.create('User', {
|
||||
email: 'friends-account@example.org',
|
||||
password: '1234',
|
||||
id: 'u565',
|
||||
id: 'not-my-account',
|
||||
})
|
||||
})
|
||||
|
||||
@ -221,7 +220,7 @@ describe('DeleteUser', () => {
|
||||
|
||||
describe("attempting to delete another user's account", () => {
|
||||
beforeEach(() => {
|
||||
variables = { ...variables, id: 'u565' }
|
||||
variables = { ...variables, id: 'not-my-account' }
|
||||
})
|
||||
|
||||
it('throws an authorization error', async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user