diff --git a/backend/src/schema/resolvers/posts.spec.js b/backend/src/schema/resolvers/posts.spec.js index cd89a4055..399602a42 100644 --- a/backend/src/schema/resolvers/posts.spec.js +++ b/backend/src/schema/resolvers/posts.spec.js @@ -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: [], diff --git a/backend/src/schema/resolvers/users.spec.js b/backend/src/schema/resolvers/users.spec.js index 5c0f7919c..e8e6205ca 100644 --- a/backend/src/schema/resolvers/users.spec.js +++ b/backend/src/schema/resolvers/users.spec.js @@ -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 () => {