skillbox/client/cypress/integration/frontend/rooms/article-page.spec.js

26 lines
710 B
JavaScript

import {getMinimalMe} from '../../../support/helpers';
describe('Article page', () => {
const operations = {
MeQuery: getMinimalMe({}),
RoomEntryQuery: {}
};
beforeEach(() => {
cy.setup();
});
it('goes to article and leaves a comment', () => {
cy.mockGraphqlOps({
operations
});
const commentText = 'First! 🖐️';
cy.visit('/article/this-article-has-a-slug');
cy.getByDataCy('comment-textarea').type(commentText);
cy.getByDataCy('emoji-button').should('have.length', 9).first().click();
cy.getByDataCy('submit-comment').should('contain', 'Kommentar teilen').click();
cy.getByDataCy('comment').first().should('contain', commentText);
});
});