More of @mattwr18's suggestions

This commit is contained in:
roschaefer 2019-09-03 15:51:18 +02:00
parent bb3f419532
commit 672f19e6d1
2 changed files with 7 additions and 8 deletions

View File

@ -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: [],

View File

@ -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 () => {