mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #731 from Human-Connection/722_comment-date
Add date relative date on comments
This commit is contained in:
commit
36f77e660e
@ -1,25 +1,28 @@
|
||||
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
|
||||
import { When, Then } from "cypress-cucumber-preprocessor/steps";
|
||||
|
||||
const narratorAvatar = 'https://s3.amazonaws.com/uifaces/faces/twitter/nerrsoft/128.jpg'
|
||||
const narratorAvatar =
|
||||
"https://s3.amazonaws.com/uifaces/faces/twitter/nerrsoft/128.jpg";
|
||||
|
||||
Then('I click on the {string} button', text => {
|
||||
cy.get('button').contains(text).click()
|
||||
})
|
||||
Then("I click on the {string} button", text => {
|
||||
cy.get("button")
|
||||
.contains(text)
|
||||
.click();
|
||||
});
|
||||
|
||||
Then('my comment should be successfully created', () => {
|
||||
cy.get('.iziToast-message')
|
||||
.contains('Comment Submitted')
|
||||
})
|
||||
Then("my comment should be successfully created", () => {
|
||||
cy.get(".iziToast-message").contains("Comment Submitted");
|
||||
});
|
||||
|
||||
Then('I should see my comment', () => {
|
||||
cy.get('div.comment p')
|
||||
.should('contain', 'Human Connection rocks')
|
||||
.get('.ds-avatar img')
|
||||
.should('have.attr', 'src')
|
||||
.and('contain', narratorAvatar)
|
||||
})
|
||||
Then("I should see my comment", () => {
|
||||
cy.get("div.comment p")
|
||||
.should("contain", "Human Connection rocks")
|
||||
.get(".ds-avatar img")
|
||||
.should("have.attr", "src")
|
||||
.and("contain", narratorAvatar)
|
||||
.get("div p.ds-text span")
|
||||
.should("contain", "today at");
|
||||
});
|
||||
|
||||
Then('the editor should be cleared', () => {
|
||||
cy.get('.ProseMirror p')
|
||||
.should('have.class', 'is-empty')
|
||||
})
|
||||
Then("the editor should be cleared", () => {
|
||||
cy.get(".ProseMirror p").should("have.class", "is-empty");
|
||||
});
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div v-else :class="{ comment: true, 'disabled-content': comment.deleted || comment.disabled }">
|
||||
<ds-space margin-bottom="x-small">
|
||||
<hc-user :user="author" />
|
||||
<hc-user :user="author" :date-time="comment.createdAt" />
|
||||
</ds-space>
|
||||
<no-ssr>
|
||||
<content-menu
|
||||
@ -45,6 +45,7 @@ export default {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
dateTime: { type: [Date, String], default: null },
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user