Commit 628c23a5 authored by Giannis Kopanas's avatar Giannis Kopanas Committed by Ana Ellis

fix configurartion read problem

parent 537d2435
......@@ -133,9 +133,11 @@ module.exports = {
sender: process.env.PUBSWEET_PASSWORD_RESET_SENDER || 'dev@example.com',
},
'pubsweet-component-ink-backend': {
inkEndpoint: 'http://inkdemo-api.coko.foundation/',
email: 'editoria@coko.foundation',
password: 'editoria',
inkEndpoint:
process.env.INK_ENDPOINT || 'http://inkdemo-api.coko.foundation/',
email: process.env.INK_USERNAME,
password: process.env.INK_PASSWORD,
maxRetries: 500,
recipes: {
'editoria-typescript': '2',
},
......
......@@ -22,8 +22,10 @@
"font-awesome": "^4.7.0",
"fs-extra": "^4.0.2",
"history": "^4.7.2",
"import-fresh": "^2.0.0",
"joi": "^10.0.6",
"loadable-components": "^0.3.0",
"mock-require": "^3.0.2",
"moment": "^2.18.1",
"prop-types": "^15.5.10",
"pubsweet": "2.2.1",
......@@ -99,12 +101,10 @@
"webpack-hot-middleware": "^2.20.0"
},
"scripts": {
"test:chrome":
"NODE_ENV=test testcafe $(testcafe -b | grep chrom*) 'test/**/*.test.js'",
"test:chrome": "NODE_ENV=test testcafe $(testcafe -b | grep chrom*) 'test/**/*.test.js'",
"test:firefox": "NODE_ENV=test testcafe firefox 'test/**/*.test.js'",
"test:e2e:ci": "npm run test:e2e:ci:chrome && npm run test:e2e:ci:firefox",
"test:e2e:ci:chrome":
"testcafe 'chrome:headless --no-sandbox' 'test/**/*.test.js'",
"test:e2e:ci:chrome": "testcafe 'chrome:headless --no-sandbox' 'test/**/*.test.js'",
"test:e2e:ci:firefox": "testcafe firefox:headless 'test/**/*.test.js'",
"test": "npm run test:chrome && npm run test:firefox",
"clean": "rm -rf node_modules",
......@@ -124,11 +124,17 @@
"testEnvironment": "node",
"testRegex": "/test/authsome/.*.test.js$",
"collectCoverage": true,
"collectCoverageFrom": ["src/**/*.js", "config/authsome.js"],
"collectCoverageFrom": [
"src/**/*.js",
"config/authsome.js"
],
"setupTestFrameworkScriptFile": "<rootDir>/test/helpers/jest-setup.js"
},
"lint-staged": {
"*.js": ["prettier --write", "git add"],
"*.js": [
"prettier --write",
"git add"
],
"*.css": "stylelint",
"*.scss": "stylelint"
}
......
import faker from 'faker'
import config from 'config'
import { Selector } from 'testcafe'
import { prepareEditor } from './helpers/prosemirror-helper'
import { startServer, setup, teardown } from './helpers/setup'
import { login, dashboard, submission } from './pageObjects'
let author
const title = 'this is a test submission'
const config = require('config')
const badInkConfig = {
inkEndpoint: 'http://testinkdemo-api.coko.foundation/',
email: 'test@example.com',
password: 'p',
const goodInkConfig = {
inkEndpoint: 'http://inkdemo-api.coko.foundation/',
email: 'editoria@coko.foundation',
password: 'editoria',
recipes: {
'editoria-typescript': '1',
'editoria-typescript': '2',
},
}
let author
const title = 'this is a test submission'
// const badInkConfig = {
// inkEndpoint: 'http://testinkdemo-api.coko.foundation/',
// email: 'test@example.com',
// password: 'p',
// recipes: {
// 'editoria-typescript': '1',
// },
// }
fixture
.only('Author user')
.before(startServer)
.before(async () => {
config['pubsweet-component-ink-backend'] = goodInkConfig
await startServer()
})
.beforeEach(async () => {
const result = await setup()
config.util.extendDeep(
{},
JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
)
author = result.userData
await login.doLogin(author.username, author.password)
......@@ -35,6 +44,7 @@ fixture
test('Manage submissions journey, create new submission', async t => {
await t.expect(Selector(dashboard.mySubmissionsTitle).exists).notOk()
// console.log(config.get('pubsweet-component-ink-backend'),1111111111111111)
await t
.setFilesToUpload(dashboard.createSubmission, ['./testSubmission1.docx'])
......@@ -132,11 +142,11 @@ test
startServer()
const result = await setup()
config.util.extendDeep(
{},
JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
JSON.parse(JSON.stringify(badInkConfig)),
)
// config.util.extendDeep(
// {},
// JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
// JSON.parse(JSON.stringify(badInkConfig)),
// )
author = result.userData
await login.doLogin(author.username, author.password)
......
......@@ -1819,12 +1819,24 @@ cache-base@^1.0.1:
union-value "^1.0.0"
unset-value "^1.0.0"
caller-callsite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
dependencies:
callsites "^2.0.0"
caller-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
dependencies:
callsites "^0.2.0"
caller-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4"
dependencies:
caller-callsite "^2.0.0"
callsite-record@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/callsite-record/-/callsite-record-4.1.1.tgz#f0b8dcc55932e64e82ebe3bffa85ebfb92d47022"
......@@ -4015,7 +4027,7 @@ generate-object-property@^1.1.0:
dependencies:
is-property "^1.0.0"
get-caller-file@^1.0.1:
get-caller-file@^1.0.1, get-caller-file@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"
......@@ -4603,6 +4615,13 @@ ignore@^3.3.3, ignore@^3.3.5, ignore@^3.3.6:
version "3.3.8"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b"
import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
dependencies:
caller-path "^2.0.0"
resolve-from "^3.0.0"
import-local@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc"
......@@ -6324,6 +6343,13 @@ mocha@^5.0.4:
mkdirp "0.5.1"
supports-color "5.4.0"
mock-require@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-3.0.2.tgz#7ce759b559e3b194be5f20a5b1cece0eb363f53d"
dependencies:
get-caller-file "^1.0.2"
normalize-path "^2.1.1"
moment-duration-format@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/moment-duration-format/-/moment-duration-format-1.3.0.tgz#541771b5f87a049cc65540475d3ad966737d6908"
......
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