Commit 25b789e9 authored by Ana Ellis's avatar Ana Ellis Committed by Giannis Kopanas

feat: add dummy data for setting up submissions

parent c5453ab8
Pipeline #8369 failed with stages
in 2 minutes and 15 seconds
......@@ -6,6 +6,8 @@ import { login, dashboard } from './pageObjects'
const config = require('config')
const fixtures = require('pubsweet-server/test/fixtures/fixtures')
const goodInkConfig = {
inkEndpoint: 'http://inkdemo-api.coko.foundation/',
email: 'editoria@coko.foundation',
......
export const collection = {
type: 'collection',
title: 'This is a dummy document for testing purposes',
owners: ['f34e6a7f-d078-4bcc-a45d-15b20ca06acf'],
status: 'submitted',
created: 1528544237670,
fragments: [
//"af967b77-b860-4e57-bd3c-dd1cf3373003"
fragment,
],
}
export const fragment = {
type: 'fragment',
files: {
manuscript: {
url: '/uploads/ec0a2df13f11ef9feaf4411b3ffd8c47.docx',
name: 'testSubmission1.docx',
},
supplementary: [],
},
notes: {
specialInstructions: 'special instructions...',
fundingAcknowledgement: '<p>funding acknowledgement...</p>',
},
owners: ['f34e6a7f-d078-4bcc-a45d-15b20ca06acf'],
source:
'<html xmlns="http://www.w3.org/1999/xhtml">\n<head><title>This is a dummy document for testing purposes</title>\n<meta charset="UTF-8"/></head>\n<body>\n<container id="main">\n<h1>This is a dummy document for testing purposes</h1></container>\n\n</body></html>',
created: '2018-06-09T11:37:17.717Z',
version: 1,
metadata: {
title: 'This is a dummy document for testing purposes',
authors: [
{
email: 'email@example.com',
lastName: 'John',
firstName: 'Cena',
affiliation: 'WWE',
},
],
abstract:
'This is a dummy document for testing purposes This is a dummy document for testing purposes This is a dummy document for testing purposes This is a dummy document for testing purposes This is a dummy document for testing purposes',
keywords: ['keywords...'],
articleType: 'original-research',
articleSection: ['clinical-psychology'],
},
submitted: '2018-06-09T11:38:29.994Z',
suggestions: {
editors: {
suggested: ['Marge Simpson'],
},
reviewers: {
suggested: ['Daffy Duck'],
},
},
declarations: {
openData: 'no',
preregistered: 'no',
researchNexus: 'no',
openPeerReview: 'no',
streamlinedReview: 'no',
previouslySubmitted: 'no',
},
fragmentType: 'version',
}
export const collection = {
type: 'collection',
title: 'This is a test document',
owners: ['f34e6a7f-d078-4bcc-a45d-15b20ca06acf'],
status: 'submitted',
created: 1528545086643,
fragments: ['e26c7029-47b0-4c12-94e8-70063ddf3d78'],
}
export const fragment = {
type: 'fragment',
files: {
manuscript: {
url: '/uploads/3f0a64b9b26b45d08b292f55219d5dc9.docx',
name: 'testSubmission1.docx',
},
supplementary: [],
},
notes: {
specialInstructions: 'confidential special instructions...',
fundingAcknowledgement: '<p>funding body acknowledgement...</p>',
},
owners: ['f34e6a7f-d078-4bcc-a45d-15b20ca06acf'],
source:
'<html xmlns="http://www.w3.org/1999/xhtml">\n<head><title>This is a test document</title>\n<meta charset="UTF-8"/></head>\n<body>\n<container id="main">\n<h1>This is a test document</h1></container>\n\n</body></html>',
created: '2018-06-09T11:51:26.697Z',
version: 1,
metadata: {
title: 'This is a test document',
authors: [
{
email: 'example@email.com',
lastName: 'Simpson',
firstName: 'Homer',
affiliation: 'Power Plant',
},
],
abstract:
'This is a test document This is a test document This is a test document This is a test document This is a test document This is a test document This is a test document',
keywords: ['keywords...'],
articleType: 'review',
articleSection: ['clinical-psychology', 'methodology'],
},
submitted: '2018-06-09T11:53:22.599Z',
suggestions: {
editors: {
suggested: ['Lisa Simpso'],
},
reviewers: {
opposed: ['Marge Simpson'],
suggested: ['Moe Szyslak'],
},
},
declarations: {
openData: 'no',
preregistered: 'no',
researchNexus: 'no',
openPeerReview: 'no',
streamlinedReview: 'no',
previouslySubmitted: 'no',
},
fragmentType: 'version',
}
import faker from 'faker'
import DestinationRequest from 'testcafe-hammerhead/lib/request-pipeline/destination-request'
import start from 'pubsweet/src/startup/start'
import { addUser, createTables } from '@pubsweet/db-manager'
import {
addUser,
createTables,
dbExists,
addCollection,
} from '@pubsweet/db-manager'
import testSubmission3 from './fixtures/testSubmission4'
import testSubmission4 from './fixtures/testSubmision4'
let server
......@@ -28,4 +35,20 @@ export async function setup(user) {
return { userData }
}
export async function setupSubmittedManuscript() {
if (dbExists) {
const collection = testSubmission3.collection
const fragment = testSubmission4.fragment
}
}
export async function setupTwoSubmittedManuscripts() {
//set up first manuscript
setupSubmittedManuscript()
//set up second manuscript
const collection = testSubmission4.collection
const fragment = testSubmission4.fragment
}
export function teardown() {}
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