diff --git a/app/components/component-xpub-dashboard/src/components/Reviews.js b/app/components/component-xpub-dashboard/src/components/Reviews.js index 1ba09e86e1b4cd1f263fac3cb17b82e3b55481f0..412ab919ec5a97337a6a41978d5b4f0a2614c782 100644 --- a/app/components/component-xpub-dashboard/src/components/Reviews.js +++ b/app/components/component-xpub-dashboard/src/components/Reviews.js @@ -52,7 +52,7 @@ const Reviews = ({ version, journal }) => ( <JournalContext.Consumer> {journal => journal.reviewStatus.map(status => ( - <BadgeContainer key={status} data-testid={status}> + <BadgeContainer data-testid={status} key={status}> <Badge count={countStatus(version, status)} label={status} /> </BadgeContainer> )) diff --git a/app/components/component-xpub-dashboard/src/components/UploadManuscript.js b/app/components/component-xpub-dashboard/src/components/UploadManuscript.js index e80199b4c20c19f9803b3bd82ad4c6f5db270a34..ab97ba22c68bb527ae7c0343d06a55034db8f068 100644 --- a/app/components/component-xpub-dashboard/src/components/UploadManuscript.js +++ b/app/components/component-xpub-dashboard/src/components/UploadManuscript.js @@ -192,9 +192,9 @@ const UploadManuscript = ({ acceptFiles, ...props }) => { return ( <StyledDropzone accept={acceptFiles} + data-testid="dropzone" disableUpload={converting ? 'disableUpload' : null} onDrop={uploadManuscript} - data-testid="dropzone" > <Root> <Main> diff --git a/app/components/component-xpub-review/src/components/ReviewPage.js b/app/components/component-xpub-review/src/components/ReviewPage.js index 35fe9955d8ab0ec0adf0f71a07dcd9121f350cb2..e6703325a549769d8dce7818df93880f0b53b591 100644 --- a/app/components/component-xpub-review/src/components/ReviewPage.js +++ b/app/components/component-xpub-review/src/components/ReviewPage.js @@ -3,7 +3,7 @@ import { graphql } from '@apollo/react-hoc' import { gql } from 'apollo-client-preset' import { withFormik } from 'formik' import { withLoader } from 'pubsweet-client' -import { cloneDeep, debounce } from 'lodash' +import { cloneDeep } from 'lodash' import { getCommentContent } from './review/util' import ReviewLayout from '../components/review/ReviewLayout' diff --git a/app/components/component-xpub-review/src/components/ReviewersPage.js b/app/components/component-xpub-review/src/components/ReviewersPage.js index 54f5b799dd1345129985618bbf2febb1d85e6bdb..001d00654ccf9dcb8fe68240a085af862e3fc070 100644 --- a/app/components/component-xpub-review/src/components/ReviewersPage.js +++ b/app/components/component-xpub-review/src/components/ReviewersPage.js @@ -3,7 +3,7 @@ import { withFormik } from 'formik' import { graphql } from '@apollo/react-hoc' import { gql } from 'apollo-client-preset' import { withLoader } from 'pubsweet-client' -import { cloneDeep, omit } from 'lodash' +import { omit } from 'lodash' import Reviewers from '../components/reviewers/Reviewers' import ReviewerContainer from '../components/reviewers/ReviewerContainer' diff --git a/app/components/component-xpub-review/src/components/review/ReviewLayout.js b/app/components/component-xpub-review/src/components/review/ReviewLayout.js index 0153dc0168865b37ad3ee51083fc06752fd312b1..89a5695715082581f34b732b2f29742163de858a 100644 --- a/app/components/component-xpub-review/src/components/review/ReviewLayout.js +++ b/app/components/component-xpub-review/src/components/review/ReviewLayout.js @@ -37,11 +37,10 @@ const ReviewLayout = ({ <div> <ReviewMetadata manuscript={manuscript} /> <Review - review={manuscript.reviews.find(review => { - return ( - (review.user.id === currentUser.id && !review.isDecision) || {} - ) - })} + review={manuscript.reviews.find( + review => + (review.user.id === currentUser.id && !review.isDecision) || {}, + )} /> </div> ), diff --git a/config/authsome.js b/config/authsome.js index bc48f83806fa63a13e9e7c86697c3dd09cd97e98..8423ba891854508b84d792884a62d2a1c90c28d4 100644 --- a/config/authsome.js +++ b/config/authsome.js @@ -42,7 +42,6 @@ class SimpleJMode { * @returns {boolean} */ async isTeamMember(role, object) { - console.log(this.user, this.user.teams) if (!this.user || !Array.isArray(this.user.teams)) { return false } diff --git a/cypress/integration/submission_spec.js b/cypress/integration/submission_spec.js index d0c08c9adbff1d96328a8bb2588681e1f32e8b59..6a3f06cc1662ba81a13cadcb832f02b5489d1937 100644 --- a/cypress/integration/submission_spec.js +++ b/cypress/integration/submission_spec.js @@ -2,10 +2,14 @@ const login = (username, password = 'password') => { cy.get('input[name="username"]') + .click() + .wait(200) .focus() .type(username) .blur() cy.get('input[name="password"]') + .click() + .wait(200) .focus() .type(password) .blur() diff --git a/cypress/videos/login_spec.js.mp4 b/cypress/videos/login_spec.js.mp4 index 679103171146affa3c9b746263521fac44365d38..2d245363bc8f701274b1f38dce382872e3926fbe 100644 Binary files a/cypress/videos/login_spec.js.mp4 and b/cypress/videos/login_spec.js.mp4 differ diff --git a/package.json b/package.json index f13b9869a83d8546bcb78aa7f7eccc06dcc85ac4..3947b4e3b9ef74372b26bf36c469ed3c5226e38b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "url": "https://gitlab.coko.foundation/simplej/simplej" }, "dependencies": { + "@apollo/react-testing": "^3.1.3", "@babel/core": "^7.0.0", "@pubsweet/base-model": "^3.5.0", "@pubsweet/coko-theme": "5.1.16", diff --git a/scripts/clearAndSeed.js b/scripts/clearAndSeed.js index 4a450aaf487eb5eb7402c312ff5c781d70ea5996..98df7a9e81a7a053631bc9447b95cff60a23b764 100644 --- a/scripts/clearAndSeed.js +++ b/scripts/clearAndSeed.js @@ -32,7 +32,7 @@ const seed = async dumpSql => { if (dumpSql) { await clearDb() await db.raw(dumpSql) - console.log('Cleared the database and restored from dump') + logger.info('Cleared the database and restored from dump') return true } diff --git a/server/manuscript/src/manuscript.js b/server/manuscript/src/manuscript.js index 1b24f368e328b7721829530ba27bc42324f55d03..682b1f86276576e6dbb010de034ba1cb60c471c6 100644 --- a/server/manuscript/src/manuscript.js +++ b/server/manuscript/src/manuscript.js @@ -135,8 +135,6 @@ class Manuscript extends BaseModel { review => review.isDecision, ) - console.log('HELLO!', manuscriptDecision) - const dataManuscript = await new Manuscript( omit(cloneDeep(this), ['id', 'created', 'updated', 'decision']), ) @@ -146,7 +144,6 @@ class Manuscript extends BaseModel { ? 'revising' : manuscriptDecision.recommendation - console.log('DATA MANUISCRIPT', dataManuscript) dataManuscript.parentId = this.parentId || this.id const newManuscript = await dataManuscript.save() @@ -155,9 +152,7 @@ class Manuscript extends BaseModel { await Promise.all( teams.map(async team => { team.objectId = newManuscript.id - team.members = team.members.map(member => { - return omit(member, 'id') - }) + team.members = team.members.map(member => omit(member, 'id')) await new Team(omit(team, ['id'])).saveGraph() }), ) diff --git a/server/manuscript/src/resolvers.js b/server/manuscript/src/resolvers.js index 5a87fdbd2806db43f869657830955a1abac819df..003b0a8e04225dcaa719e4497d62f763a99df62f 100644 --- a/server/manuscript/src/resolvers.js +++ b/server/manuscript/src/resolvers.js @@ -125,7 +125,6 @@ const resolvers = { const data = JSON.parse(input) const manuscript = await ctx.connectors.Manuscript.fetchOne(id, ctx) - console.log(manuscript, 'hello!') const update = merge({}, manuscript, data) // eslint-disable-next-line const previousVersion = await new ctx.connectors.Manuscript.model( diff --git a/yarn.lock b/yarn.lock index 23afb0f12108c4a8efbb33121b3ced643502d307..9e4d3f334c911e1fda4e8acc08f1c119be1b049a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,6 +61,15 @@ ts-invariant "^0.4.4" tslib "^1.10.0" +"@apollo/react-testing@^3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@apollo/react-testing/-/react-testing-3.1.3.tgz#d8dd318f58fb6a404976bfa3f8a79e976a5c6562" + integrity sha512-58R7gROl4TZMHm5kS76Nof9FfZhD703AU3SmJTA2f7naiMqC9Qd8pZ4oNCBafcab0SYN//UtWvLcluK5O7V/9g== + dependencies: + "@apollo/react-common" "^3.1.3" + fast-json-stable-stringify "^2.0.0" + tslib "^1.10.0" + "@apollographql/apollo-tools@^0.4.0": version "0.4.1" resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.4.1.tgz#bfe582d7da4d0f9d449c059cfc983a46f331d529"