mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #2443 from Human-Connection/2237-longer-comments
Fix #2237, Comments 4 times as long before "show more"
This commit is contained in:
commit
65cf8e4792
@ -3,6 +3,14 @@ import { When, Then } from "cypress-cucumber-preprocessor/steps";
|
||||
const narratorAvatar =
|
||||
"https://s3.amazonaws.com/uifaces/faces/twitter/nerrsoft/128.jpg";
|
||||
|
||||
When("I type in a comment with {int} characters", size => {
|
||||
var c="";
|
||||
for (var i = 0; i < size; i++) {
|
||||
c += "c"
|
||||
}
|
||||
cy.get(".editor .ProseMirror").type(c);
|
||||
});
|
||||
|
||||
Then("I click on the {string} button", text => {
|
||||
cy.get("button")
|
||||
.contains(text)
|
||||
@ -23,6 +31,16 @@ Then("I should see my comment", () => {
|
||||
.should("contain", "today at");
|
||||
});
|
||||
|
||||
Then("I should see the entirety of my comment", () => {
|
||||
cy.get("div.comment")
|
||||
.should("not.contain", "show more")
|
||||
});
|
||||
|
||||
Then("I should see an abreviated version of my comment", () => {
|
||||
cy.get("div.comment")
|
||||
.should("contain", "show more")
|
||||
});
|
||||
|
||||
Then("the editor should be cleared", () => {
|
||||
cy.get(".ProseMirror p").should("have.class", "is-empty");
|
||||
});
|
||||
|
||||
@ -20,3 +20,19 @@ Feature: Post Comment
|
||||
Then my comment should be successfully created
|
||||
And I should see my comment
|
||||
And the editor should be cleared
|
||||
|
||||
Scenario: View medium length comments
|
||||
Given I visit "post/bWBjpkTKZp/101-essays"
|
||||
And I type in a comment with 305 characters
|
||||
And I click on the "Comment" button
|
||||
Then my comment should be successfully created
|
||||
And I should see the entirety of my comment
|
||||
And the editor should be cleared
|
||||
|
||||
Scenario: View long comments
|
||||
Given I visit "post/bWBjpkTKZp/101-essays"
|
||||
And I type in a comment with 1205 characters
|
||||
And I click on the "Comment" button
|
||||
Then my comment should be successfully created
|
||||
And I should see an abreviated version of my comment
|
||||
And the editor should be cleared
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export const COMMENT_MIN_LENGTH = 1
|
||||
export const COMMENT_MAX_UNTRUNCATED_LENGTH = 300
|
||||
export const COMMENT_MAX_UNTRUNCATED_LENGTH = 1200
|
||||
export const COMMENT_TRUNCATE_TO_LENGTH = 180
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user