Skip to content

Commit

Permalink
Go back to the list of other authors from the remove-an-author step
Browse files Browse the repository at this point in the history
Refs #388
  • Loading branch information
thewilkybarkid committed Oct 20, 2022
1 parent 74e2f62 commit 435424d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion integration/posting-a-prereview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ test('can go back through the form', async ({ fetch, javaScriptEnabled, page })
}
})

test('see existing values when going back a step', async ({ fetch, javaScriptEnabled, page }) => {
test.extend(canAddAuthors)('see existing values when going back a step', async ({ fetch, javaScriptEnabled, page }) => {
await page.goto('/preprints/doi-10.1101-2022.01.13.476201/write-a-prereview')

fetch.postOnce('http://orcid.test/token', {
Expand Down Expand Up @@ -1112,6 +1112,34 @@ test('see existing values when going back a step', async ({ fetch, javaScriptEna

await expect(page.locator('text="No, by myself"')).toBeChecked()

await page.check('text="Yes"')
await page.click('text="Save and continue"')

await page.click('text="Back"')

await expect(page.locator('text="Yes"')).toBeChecked()

await page.click('text="Save and continue"')

await page.fill('role=textbox[name="Name"]', 'Otto Lidenbrock')
await page.click('text="Save and continue"')

await page.click('role=link[name="Change Otto Lidenbrock"]')

await page.click('text="Back"')

await expect(page.locator('h1')).toContainText('You have added 1 other author')

await page.click('role=link[name="Remove Otto Lidenbrock"]')

await page.click('text="Back"')

await expect(page.locator('h1')).toContainText('You have added 1 other author')

await page.click('text="Back"')

await expect(page.locator('text="Yes"')).toBeChecked()

await page.click('text="Back"')

await expect(page.locator('text="Josiah Carberry"')).toBeChecked()
Expand Down
2 changes: 1 addition & 1 deletion src/write-review/write-review-remove-author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function removeAuthorForm(preprint: Preprint, author: Author, form: RemoveAuthor
}”`,
content: html`
<nav>
<a href="${format(writeReviewAuthorsMatch.formatter, { doi: preprint.doi })}" class="back">Back</a>
<a href="${format(writeReviewAddAuthorsMatch.formatter, { doi: preprint.doi })}" class="back">Back</a>
</nav>
<main>
Expand Down

0 comments on commit 435424d

Please sign in to comment.