From ed7aa80a3a0619f5e6129d2fcc360336418135d5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 15 Jul 2017 15:14:01 -0700 Subject: [PATCH] WIP --- server/models/User.test.js | 11 ++--------- server/test/support.js | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/server/models/User.test.js b/server/models/User.test.js index db155667e..343b29d0a 100644 --- a/server/models/User.test.js +++ b/server/models/User.test.js @@ -1,16 +1,9 @@ -import { User } from '.'; - -import { flushdb, sequelize } from '../test/support'; +import { flushdb, seed } from '../test/support'; beforeEach(flushdb); it('should set JWT secret and password digest', async () => { - const user = User.build({ - username: 'user', - name: 'User', - email: 'user1@example.com', - password: 'test123!', - }); + const { user } = await seed(); await user.save(); expect(user.passwordDigest).toBeTruthy(); diff --git a/server/test/support.js b/server/test/support.js index 128ede92e..33f915095 100644 --- a/server/test/support.js +++ b/server/test/support.js @@ -45,10 +45,10 @@ const seed = async () => { type: 'atlas', }); - let document = await Document.create({ + const document = await Document.create({ parentDocumentId: null, atlasId: collection.id, - teamId: collection.teamId, + teamId: team.id, userId: collection.creatorId, lastModifiedById: collection.creatorId, createdById: collection.creatorId,