Update spell check cypress test

This commit is contained in:
Ramon Wenger 2021-08-03 17:32:12 +02:00
parent 815dfe7b07
commit a6c483c67c
3 changed files with 5 additions and 4 deletions

View File

@ -145,8 +145,8 @@ describe('Spellcheck', () => {
cy.fakeLogin('rachel.green', 'test'); cy.fakeLogin('rachel.green', 'test');
cy.visit('/module/lohn-und-budget/'); cy.visit('/module/lohn-und-budget/');
cy.get('.spellcheck__correction').should('have.length', 0); cy.getByDataCy('spellcheck-correction').should('have.length', 0);
cy.get('.submission-form-container__spellcheck').click(); cy.getByDataCy('spellcheck-button').click();
cy.get('.spellcheck__correction').should('have.length', 3); cy.getByDataCy('spellcheck-correction').should('have.length', 3);
}); });
}); });

View File

@ -40,7 +40,7 @@
if (part.correct) { if (part.correct) {
return `${previous}${part.text}`; return `${previous}${part.text}`;
} else { } else {
return `${previous}<span class="spellcheck__correction">${part.text}</span>`; return `${previous}<span data-cy="spellcheck-correction" class="spellcheck__correction">${part.text}</span>`;
} }
}, ''); }, '');
} }

View File

@ -21,6 +21,7 @@
</button> </button>
<button <button
class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg" class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg"
data-cy="spellcheck-button"
v-if="showSpellcheckButton" v-if="showSpellcheckButton"
@click="$emit('spellcheck')" @click="$emit('spellcheck')"
>{{ spellcheckText }} >{{ spellcheckText }}