Skip to content

Commit 6839649

Browse files
committed
Add navigation for browsing between comments
1 parent 81f3a00 commit 6839649

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

cypress/e2e/projects/detail/comments.spec.js

+30-1
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,43 @@ describe('Comments', () => {
267267
cy.getCy('comments_comment_resolve').click()
268268

269269
cy.get('.item').contains('Comments').click()
270-
cy.get('.comments-overview .form-check-label').should('contain', 'View resolved comments (1)').click()
270+
cy.get('.comments-overview .form-check-label').should('contain', 'View resolved comments').click()
271271
cy.get('.comments-overview .fa-ul li').should('contain', 'Options Question 1')
272272
cy.get('.comments-overview .fa-ul li .bg-success.rounded-pill').should('contain', '1')
273273
cy.get('.comments-overview .fa-ul li a').click()
274274

275275
cy.get('.CommentThread.CommentThread--Resolved').should('exist')
276276
})
277277

278+
it('navigate between comments', () => {
279+
project.openCommentsFor('Options Question 1')
280+
project.startNewCommentThread('Thread 1')
281+
project.openCommentsFor('Integration Question 1')
282+
project.startNewCommentThread('Thread 2')
283+
project.openCommentsFor('Question 2')
284+
project.startNewCommentThread('Thread 3')
285+
286+
project.openCommentsFor('Options Question 1')
287+
cy.getCy('comments_nav_count').should('contain', '1/3')
288+
cy.get('.Comment_MD').contains('Thread 1').should('exist')
289+
290+
cy.getCy('comments_nav_next').click()
291+
cy.getCy('comments_nav_count').should('contain', '2/3')
292+
cy.get('.Comment_MD').contains('Thread 2').should('exist')
293+
294+
cy.getCy('comments_nav_next').click()
295+
cy.getCy('comments_nav_count').should('contain', '3/3')
296+
cy.get('.Comment_MD').contains('Thread 3').should('exist')
297+
298+
cy.getCy('comments_nav_next').click()
299+
cy.getCy('comments_nav_count').should('contain', '1/3')
300+
cy.get('.Comment_MD').contains('Thread 1').should('exist')
301+
302+
cy.getCy('comments_nav_prev').click()
303+
cy.getCy('comments_nav_count').should('contain', '3/3')
304+
cy.get('.Comment_MD').contains('Thread 3').should('exist')
305+
})
306+
278307
it('websocket', () => {
279308
project.setProjectSharing(project.AnyoneWithLinkEdit)
280309

0 commit comments

Comments
 (0)