Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cypress/tests/clikes/clikes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ describe('Users can like comments', () => {
// 2. user B likes this comment
// 3. user B sees +1 comment like
// 4. user A cannot like their own comment
// 5. user A can see user B in clikes-popup
// 6. user B can unclike

const userA = randomUser();
const userB = randomUser();
Expand Down Expand Up @@ -33,7 +35,18 @@ describe('Users can like comments', () => {
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('1 comment like').should('exist');
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('Like this comment').click();
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('1 comment like').should('exist');
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('1 comment like').click();
//here be check for popup later
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я думаю, не стоит добавлять недописанные тесты и TODO. Когда в клиенте будут изменения для попапа клайков, тогда напишем этот тест.

});

cy.login(userB).then(() => {
cy.visit(`/${userA.username}/${postId}`);
cy.findByRole('article').should('exist');
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('Like this comment').click();
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('1 comment like').should('not.exist');
cy.get('[role=main]').findAllByRole('comment').eq(0).findByLabelText('Like this comment').should('exist');
});

});
});
});
Expand Down