Skip to content

Commit

Permalink
Merge pull request #1009 from Onlineberatung/feat/OB-9486
Browse files Browse the repository at this point in the history
fix: registration consulting types
  • Loading branch information
web-mi authored Feb 23, 2024
2 parents 22afeb7 + abd3a46 commit 5b4217a
Show file tree
Hide file tree
Showing 68 changed files with 3,791 additions and 930 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ REACT_APP_DISABLE_2FA_DUTY=0

### Registration
# Enable fallback loader for direct link registration where slug could not be matched (0/1)
FRONTEND_REGISTRATION_DIRECTLINK_FALLBACKLOADER_ENABLED=
FRONTEND_REGISTRATION_USE_CONSULTINGTYPE_SLUG=

### Weblate
# Weblate host
Expand Down
34 changes: 21 additions & 13 deletions cypress/e2e/appointments.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { v4 as uuid } from 'uuid';
import { USER_CONSULTANT, USER_VIDEO } from '../support/commands/login';
import { USER_CONSULTANT, USER_VIDEO } from '../support/commands/mockApi';
import {
closeWebSocketServer,
mockWebSocket,
Expand Down Expand Up @@ -78,7 +78,7 @@ describe('appointments', () => {
describe('Consultant', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_CONSULTANT
userId: USER_CONSULTANT
});
});

Expand All @@ -90,7 +90,7 @@ describe('appointments', () => {
describe('Video Consultant', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_VIDEO
userId: USER_VIDEO
});
});

Expand Down Expand Up @@ -123,7 +123,7 @@ describe('appointments', () => {
describe('Consultant', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_CONSULTANT
userId: USER_CONSULTANT
});
});

Expand All @@ -135,7 +135,7 @@ describe('appointments', () => {
describe('Video Consultant', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_VIDEO
userId: USER_VIDEO
});
});

Expand Down Expand Up @@ -408,12 +408,16 @@ describe('appointments', () => {

describe('E2EE check enabled', () => {
beforeEach(() => {
cy.willReturn('userData', {
e2eEncryptionEnabled: true
});
cy.willReturn(
'userData',
{
e2eEncryptionEnabled: true
},
true
);

cy.fastLogin({
username: USER_VIDEO
userId: USER_VIDEO
});

cy.contains('Video - Termine').click();
Expand Down Expand Up @@ -483,12 +487,16 @@ describe('appointments', () => {

describe('E2EE check disabled', () => {
beforeEach(() => {
cy.willReturn('userData', {
e2eEncryptionEnabled: false
});
cy.willReturn(
'userData',
{
e2eEncryptionEnabled: false
},
true
);

cy.fastLogin({
username: USER_VIDEO
userId: USER_VIDEO
});

cy.contains('Video - Termine').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Login', () => {
cy.contains('Datenschutzerklärung');
});

it('displays the login for resorts', () => {
it.only('displays the login for resorts', () => {
cy.visit('/suchtberatung');
cy.contains('Login');
});
Expand Down
23 changes: 7 additions & 16 deletions cypress/e2e/profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
mockWebSocket,
startWebSocketServer
} from '../support/websocket';
import { USER_CONSULTANT } from '../support/commands/login';
import { USER_CONSULTANT } from '../support/commands/mockApi';

describe('profile', () => {
before(() => {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('profile', () => {
describe('consultant absence', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_CONSULTANT
userId: USER_CONSULTANT
});
});

Expand All @@ -126,9 +126,6 @@ describe('profile', () => {
cy.contains('Meine Aktivitäten').click();
cy.contains('Hinterlegen Sie eine Abwesenheitsnachricht');

cy.willReturn('userData', {
absent: true
});
cy.get('#absenceForm .mr--1').click();
cy.get('.button__autoClose').click();
cy.contains(
Expand All @@ -138,10 +135,6 @@ describe('profile', () => {
'be.disabled'
);

cy.willReturn('userData', {
absent: false
});

cy.get('#absenceForm .mr--1').click();
cy.get('.button__autoClose').click();
cy.contains('Hinterlegen Sie eine Abwesenheitsnachricht');
Expand All @@ -156,12 +149,10 @@ describe('profile', () => {
cy.contains('Meine Aktivitäten').click();
cy.contains('Hinterlegen Sie eine Abwesenheitsnachricht');

cy.get('#absenceForm .generalInformation textarea')
.type(
'Liebe Ratsuchende, ich bin im Urlaub vom 23.05.2022 bis 05.06.2022.'
)
.get('#absenceForm .mr--1')
.click();
cy.get('#absenceForm .generalInformation textarea').type(
'Liebe Ratsuchende, ich bin im Urlaub vom 23.05.2022 bis 05.06.2022.'
);
cy.get('#absenceForm .mr--1').click();
cy.get('.button__autoClose').click();
cy.contains(
'Deaktivieren Sie Ihre Abwesenheit, um eine Nachricht zu hinterlegen oder sie zu bearbeiten.'
Expand All @@ -182,7 +173,7 @@ describe('profile', () => {
describe('consultant email notification', () => {
beforeEach(() => {
cy.fastLogin({
username: USER_CONSULTANT
userId: USER_CONSULTANT
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { endpoints } from '../../src/resources/scripts/endpoints';
import { endpoints } from '../../../src/resources/scripts/endpoints';
import {
closeWebSocketServer,
mockWebSocket,
startWebSocketServer
} from '../support/websocket';
} from '../../support/websocket';

const checkForGenericRegistrationElements = () => {
cy.get('#loginLogoWrapper').should('exist');
Expand Down
Loading

0 comments on commit 5b4217a

Please sign in to comment.