-
Notifications
You must be signed in to change notification settings - Fork 841
AO3-7083 Update text on comment form for guests #5291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,3 +43,26 @@ Scenario: Guest comments with embedded images are rendered as plain text | |
| And I should see "alt=" | ||
| And I should see "baz" | ||
| But I should not see the image "src" text "https://example.com/image.jpg" | ||
|
|
||
| Scenario: Guest sees warning footnote and required fields on comment form | ||
| Given the work "Test Work" by "author" with guest comments enabled | ||
| When I go to the work "Test Work" | ||
| Then I should see "You will not be able to edit or delete your comment after it is posted." | ||
| And I should see "Guest name (required)" | ||
| And I should see "Guest email (required)" | ||
| And I should see "All fields are required. Your name and comment text will both be publicly displayed. Your email address will not be made public, but it will be used to send you notifications of any replies to your comment." | ||
|
|
||
| Scenario: Logged-in user does not see guest-specific elements | ||
| Given the work "Test Work" by "author" with guest comments enabled | ||
| And I am logged in as "commenter" | ||
| When I go to the work "Test Work" | ||
| Then I should not see "You will not be able to edit or delete your comment after it is posted." | ||
| And I should not see "Guest name (required)" | ||
| And I should not see "Guest email (required)" | ||
| And I should not see "All fields are required. Your name and comment text will both be publicly displayed. Your email address will not be made public, but it will be used to send you notifications of any replies to your comment." | ||
|
|
||
| Scenario: Guest comment validation messages appear correctly | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is a bit out of place. The errors are created in the model, so this should be a model test. However, the changes here doesn't affect this behaviour, so I think you can just remove the test.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Bilka2! This is my first time working with cucumber test and the comments are super helpful. I currently don’t have access to my computer, and will make revision in ~1 week when I do! |
||
| Given the work "Test Work" by "author" with guest comments enabled | ||
| When I go to the work "Test Work" | ||
| And I try to submit a comment without filling required fields | ||
| Then I should see validation messages for guest name and email | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -404,3 +404,18 @@ | |
| When "I reply on a new page" do | ||
| visit find(:link, "Reply")["href"] | ||
| end | ||
|
|
||
| When "I try to submit a comment without filling required fields" do | ||
| click_button("Comment") | ||
| end | ||
|
|
||
| # error for the server-side validation. The error shown to user on the client side will be "Please enter your name.", "Please enter your email address." | ||
| Then "I should see validation messages for guest name and email" do | ||
| expect(page).to have_content("Name can't be blank") | ||
| expect(page).to have_content("Email should look like an email address.") | ||
| end | ||
|
|
||
| Then "I should see a required field for {string}" do |field_name| | ||
| expect(page).to have_selector("dt.required", text: field_name) | ||
| expect(page).to have_selector("dd.required") | ||
| end | ||
|
Comment on lines
+418
to
+421
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step not used in a test which is okay because we don't need a test for a HTML class. However, please remove the unused step |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're in this file for the other review comment, please indent the "And" steps one extra level (also in the other scenario)