Commit 3df4a9b7 authored by Sam Galson's avatar Sam Galson

partially fix test setup

parent f2479ba9
......@@ -2,28 +2,22 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1200000
const logger = require('@pubsweet/logger')
const fixtures = require('./fixtures')
const dbconfig = fixtures.dbconfig
const dbConfig = fixtures.dbconfig
const flow = require('./helpers/flow')
const pubsweet = require('./helpers/pubsweet')
const dbManager = require('@pubsweet/db-manager')
const start = require('pubsweet/src/start/index.js')
describe('start', () => {
let server
beforeAll(async (done) => {
try {
await require('../src/scripts/generate-env')()
await require('../src/scripts/newdb')({
properties: require('../src/scripts/db-properties'),
override: dbconfig
})
await dbManager.setupDb(dbConfig)
logger.info('Starting server')
require('../src/scripts/start')(_server => {
server = _server
logger.info('Server started')
done()
})
server = await start()
logger.info('Server started')
done()
} catch (e) {
done.fail(e)
}
......@@ -45,12 +39,12 @@ describe('start', () => {
it('should allow admin to log in', async () => {
const promise = flow()
.use(pubsweet.login(dbconfig))
.use(pubsweet.login(dbConfig))
.waitForUrl(/manage.posts/)
.wait('nav')
.evaluate(() => document.querySelector('h2').innerText)
.end()
await expect(promise).resolves.toBe(dbconfig.collection)
await expect(promise).resolves.toBe(dbConfig.collection)
})
})
......@@ -4,7 +4,7 @@
"@pubsweet/db-manager@git+https://gitlab.coko.foundation/yld/db-manager.git":
version "0.0.2"
resolved "git+https://gitlab.coko.foundation/yld/db-manager.git#e50ac08e7178533300ff6850b1c11102303cd35a"
resolved "git+https://gitlab.coko.foundation/yld/db-manager.git#4df92e5dfffc4acc319949314ab750a04a618ae9"
dependencies:
"@pubsweet/logger" "0.0.1"
fs-extra "^4.0.2"
......@@ -7223,7 +7223,7 @@ pubsweet-theme-plugin@^0.0.1:
"pubsweet@git+https://git@gitlab.coko.foundation/yld/pubsweet-cli.git#refactor/db-manager":
version "1.0.0-alpha.4"
resolved "git+https://git@gitlab.coko.foundation/yld/pubsweet-cli.git#e0f04422fb7518aff26df5b1c645e51dc666a48e"
resolved "git+https://git@gitlab.coko.foundation/yld/pubsweet-cli.git#2b8c852dfc44cf1f87661de6b235567339678dbd"
dependencies:
"@pubsweet/db-manager" "git+https://gitlab.coko.foundation/yld/db-manager.git"
"@pubsweet/logger" "^0.0.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment