diff --git a/client/cypress/integration/registration.spec.js b/client/cypress/integration/registration.spec.js
index 1967b42d..465f2db9 100644
--- a/client/cypress/integration/registration.spec.js
+++ b/client/cypress/integration/registration.spec.js
@@ -144,6 +144,18 @@ describe('Registration', () => {
cy.get('[data-cy="passwordConfirmation-local-errors"]').contains('Die Bestätigung von Passwort wiederholen stimmt nicht überein');
});
+ it('displays error if terms are not accepted', () => {
+ cy.route('POST', isEmailAvailableUrl, "true");
+ cy.route('POST', registerUrl, registrationResponse);
+
+ cy.visit('/hello');
+ cy.checkEmailAvailable(registrationResponse.email);
+
+ cy.get('[data-cy="registration-title"]').contains('Damit Sie mySkillbox verwenden können, müssen Sie ein Konto erstellen.');
+ cy.register(registrationResponse.gender, registrationResponse.firstname, registrationResponse.lastname, 'Weg 1', 'Bern', '3001', 'Abcd1234!', 'Abcd1234!', false);
+ cy.get('[data-cy="acceptedTerms-local-errors"]').contains('Die AGBs und die Datenschutzbestimmungen müssen akzeptiert werden');
+ });
+
it('redirects to hello if email is missing', () => {
cy.visit('/register');
cy.get('[data-cy="hello-title"]').contains('Wollen sie mySkillbox jetzt im Unterricht verwenden?');
diff --git a/client/cypress/support/commands.js b/client/cypress/support/commands.js
index 8eb91930..e16af203 100644
--- a/client/cypress/support/commands.js
+++ b/client/cypress/support/commands.js
@@ -121,7 +121,7 @@ Cypress.Commands.add('enterPassword', (password) => {
cy.get('[data-cy="login-button"]').click();
});
-Cypress.Commands.add('register', (prefix, firstname, lastname, street, city, postcode, password, passwordConfirmation) => {
+Cypress.Commands.add('register', (prefix, firstname, lastname, street, city, postcode, password, passwordConfirmation, acceptTerms=true) => {
let selection = prefix === 1 ? 'Herr' : 'Frau';
@@ -150,6 +150,10 @@ Cypress.Commands.add('register', (prefix, firstname, lastname, street, city, pos
cy.get('[data-cy="password-input"]').type(password);
}
+ if (acceptTerms) {
+ cy.get('[data-cy="acceptedTerms-input"]').click();
+ }
+
cy.get('[data-cy="passwordConfirmation-input"]').type(passwordConfirmation);
cy.get('[data-cy="register-button"]').click();
});
diff --git a/client/src/components/Checkbox.vue b/client/src/components/Checkbox.vue
index e177d87e..112af7d6 100644
--- a/client/src/components/Checkbox.vue
+++ b/client/src/components/Checkbox.vue
@@ -5,7 +5,9 @@
:item="item"
:type="'checkbox'"
@input="passOn"
- />
+ >
+
+