Update cypress test

This commit is contained in:
Ramon Wenger 2022-06-23 16:07:55 +02:00
parent cc28a44c6a
commit cb84a1576c
3 changed files with 16 additions and 9 deletions

View File

@ -61,13 +61,13 @@ describe('The Room Page', () => {
}); });
cy.visit(`/room/${slug}`); cy.visit(`/room/${slug}`);
cy.get('[data-cy=add-room-entry-button]').click(); cy.getByDataCy('add-room-entry-button').click();
cy.get('.add-content-element:first-of-type').click(); cy.getByDataCy('add-content-link').first().click();
cy.get('[data-cy=choose-text-widget]').click(); cy.getByDataCy('choose-text-widget').click();
cy.get('[data-cy=modal-title-input] > .modal-input__inputfield').type(entryTitle); cy.getByDataCy('input-with-label-input').type(entryTitle);
cy.get('[data-cy=text-form-input]').type(entryText); cy.get('.tip-tap__editor').type(entryText);
cy.get('[data-cy=modal-save-button]').click(); cy.getByDataCy('save-button').click();
cy.get('.room-entry__content:first').should('contain', entryText).should('contain', 'Rachel Green'); cy.get('.room-entry__content:first').should('contain', entryText).should('contain', 'Rachel Green');
}); });
@ -240,7 +240,8 @@ describe('The Room Page', () => {
cy.visit(`/room/${slug}`); cy.visit(`/room/${slug}`);
cy.getByDataCy('add-room-entry-button').click(); cy.getByDataCy('add-room-entry-button').click();
cy.getByDataCy('add-room-entry-modal').should('exist');
cy.getByDataCy('content-form-section-title').should('have.text', 'Titel (Pflichtfeld)');
}); });
it('changes class while on room page', () => { it('changes class while on room page', () => {

View File

@ -19,7 +19,10 @@
/> />
<!-- Form for title of content block --> <!-- Form for title of content block -->
<content-form-section title="Titel (Pflichtfeld)"> <content-form-section
data-cy="content-form-title-section"
title="Titel (Pflichtfeld)"
>
<input-with-label <input-with-label
:value="localContentBlock.title" :value="localContentBlock.title"
data-cy="content-block-title" data-cy="content-block-title"

View File

@ -4,7 +4,10 @@
<component <component
class="content-form-section__icon" class="content-form-section__icon"
:is="icon" :is="icon"
/> <span class="content-form-section__title">{{ title }}</span> /> <span
class="content-form-section__title"
data-cy="content-form-section-title"
>{{ title }}</span>
</h2> </h2>
<content-element-actions <content-element-actions