Commit e2b6fafe authored by Ana Ellis's avatar Ana Ellis
Browse files

feat: review selectors updated

parent d49bc0c1
......@@ -563,11 +563,11 @@ module.exports = {
// currently we take for granted that an admin is the Managing Editor
// Temporally we need this if statement to prevent admin from seeing
// review and submission section on dashboard (ME permissions)
if (
operation === 'can view review section' ||
operation === 'can view my submission section'
)
return false
// if (
// operation === 'can view review section' ||
// operation === 'can view my submission section'
// )
// return false
return user.admin
},
......
......@@ -33,20 +33,22 @@ const dashboard = {
.find('a')
.withText('Delete'),
myReviewsTitle: Selector('#root div div div div').child(2),
myReviews: Selector('#root div div div div div'),
myReviewsTitle: Selector('#root div div div div div').child(2),
myReviews: Selector('#root div div div div'),
review: n => dashboard.myReviews.child(n), //specified review
//#root > div > div > div > div > div:nth-child(2) > div:nth-child(3) > div.sc-esOvli.fmvhd > div.sc-fAjcbJ.dqylwE > div:nth-child(1) > a
//#root > div > div > div > div > div:nth-child(3) > div:nth-child(3) > div > div.sc-exAgwC.kvVgIg > div:nth-child(1) > button
acceptReview: n =>
dashboard.myReviews
.child(n)
.child('a')
.withText('Accept'),
.find('button')
.withText('accept'),
rejectReview: n =>
dashboard.myReviews
.child(n)
.find('a')
.withText('Reject'),
.find('button')
.withText('reject'),
doReview: n =>
dashboard.myReviews
.child(n)
......@@ -58,14 +60,6 @@ const dashboard = {
.find('a')
.withText('Completed'),
// acceptReview: Selector('a').withText('Accept'),
// rejectReview: Selector('a').withText('Reject'),
// doReview: Selector('a').withText('Do review'),
// completed: Selector('a').withText('Completed'),
doReview: Selector('a').withText('Do review'),
completed: Selector('a').withText('Completed'),
myManuscriptsTitle: Selector('#root div div div div').child(3),
myManuscripts: Selector('#root div div div div'),
manuscript: n => dashboard.myManuscripts.child(n), // specified manuscript
......
......@@ -83,7 +83,7 @@ test.before(async t => {
//1.1 assign reviewers
// assign reviewer to first manuscript
await t.click(dashboard.controlPanel)
await t.click(dashboard.controlPanel(1))
await t
.click(review.assignReviewers)
......@@ -105,43 +105,52 @@ test.before(async t => {
// end
// assign reviewer to second manuscript
await t.debug().click(dashboard.controlPanel)
// await t.debug().click(dashboard.controlPanel(2))
// await t
// .click(review.assignReviewers)
// .expect(Selector(reviewers.reviewerSelect).exists)
// .ok()
// .click(reviewers.reviewerSelect)
// await t
// .expect(await Selector(reviewers.reviewer.withText(author.username)).exists)
// .ok()
// await t
// .click(reviewers.reviewer.withText(author.username))
// .expect(await Selector(reviewers.inviteReviewer).exists)
// .ok()
// .click(reviewers.inviteReviewer)
// end
await t
.click(review.assignReviewers)
.expect(Selector(reviewers.reviewerSelect).exists)
.ok()
.click(reviewers.reviewerSelect)
//2. there should be two manuscripts in the My Reviews section
//3. both manuscripts in the My Reviews section should show an accept / reject option
await t
.expect(await Selector(reviewers.reviewer.withText(author.username)).exists)
.expect(Selector(dashboard.review(0)).exists)
.ok()
await t
.click(reviewers.reviewer.withText(author.username))
.expect(await Selector(reviewers.inviteReviewer).exists)
.expect(Selector(dashboard.review(1)).exists)
.ok()
.click(reviewers.inviteReviewer)
// end
//2. there should be two manuscripts in the My Reviews section
//3. both manuscripts in the My Reviews section should show an accept / reject option
console.log('dashboard.review = ', dashboard.review(1).innerText)
await t
.debug()
.expect(Selector(dashboard.acceptReview(1)).exists)
.ok()
.expect(Selector(dashboard.rejectReview(1)).exists)
.ok()
.expect(Selector(dashboard.acceptReview(2)).exists)
.ok()
.expect(Selector(dashboard.rejectReview(2)).exists)
.ok()
// .expect(Selector(dashboard.acceptReview(1)).exists)
// .ok()
// .expect(Selector(dashboard.rejectReview(1)).exists)
// .ok()
//4. click on reject for the first manuscript
//5. the rejected manuscript should not be in the list anymore
await t
.click(dashboard.rejectReview(1))
.click(dashboard.rejectReview(0))
// rejected manuscript should not be in the My Reviews list anymore ?
// current behaviour actually replaces the accept/reject links with a singular readonly 'rejected' string
.expect(Selector(dashboard.acceptReview(1)).exists)
......
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