Skip to content

Commit

Permalink
Merge pull request #66 from virtualidentityag/VIC-Sync
Browse files Browse the repository at this point in the history
Vic sync
  • Loading branch information
web-mi authored Jul 19, 2022
2 parents 8a15832 + 840d5c5 commit edbf177
Show file tree
Hide file tree
Showing 170 changed files with 8,571 additions and 3,625 deletions.
5 changes: 5 additions & 0 deletions cypress/fixtures/releases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"1001": {
"file": "releaseNote.md"
}
}
20 changes: 20 additions & 0 deletions cypress/fixtures/service.agency.consultants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"agencies": null,
"consultantId": "8a81117b-d875-4ba4-8696-d62c3a2dae91",
"firstName": "Berater",
"lastName": "No2"
},
{
"agencies": null,
"consultantId": "a5dc222c-94c0-4c1b-9654-0a5c34008de6",
"firstName": "Berater",
"lastName": "No3"
},
{
"agencies": null,
"consultantId": "330fc01c-bac3-4c7c-ba91-d0e974f1abd0",
"firstName": "consultant4",
"lastName": "consultant4"
}
]
6 changes: 5 additions & 1 deletion cypress/fixtures/service.users.data.consultants.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"consultingType": 0
}
],
"grantedAuthorities": ["AUTHORIZATION_CONSULTANT_DEFAULT"],
"grantedAuthorities": [
"AUTHORIZATION_CONSULTANT_DEFAULT",
"AUTHORIZATION_VIEW_AGENCY_CONSULTANTS",
"AUTHORIZATION_ASSIGN_CONSULTANT_TO_SESSION"
],
"hasAnonymousConversations": false,
"consultingTypes": null,
"formalLanguage": true,
Expand Down
38 changes: 38 additions & 0 deletions cypress/fixtures/service.users.sessions.room.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"session": {
"id": 9876,
"agencyId": 2,
"consultingType": 2,
"status": 2,
"postcode": "12345",
"language": "de",
"groupId": "someGroupId",
"feedbackGroupId": null,
"isPeerChat": false,
"askerRcId": "askerRcId",
"e2eLastMessage": null,
"lastMessage": null,
"messageDate": 0,
"messagesRead": false,
"feedbackRead": true,
"isTeamSession": false,
"monitoring": false,
"registrationType": "REGISTERED",
"createDate": "2022-06-15T08:09:18Z",
"attachment": null,
"videoCallMessageDTO": null
},
"chat": null,
"user": {
"username": "username",
"sessionData": {}
},
"consultant": {
"firstName": "firstName",
"lastName": "lastName",
"id": "12345-54321-asdf-fdsa",
"absent": false
},
"agency": null,
"latestMessage": "1970-01-01T01:00:00.000+01:00"
}
4 changes: 2 additions & 2 deletions cypress/integration/messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Messages', () => {
mockWebSocket();
});

describe('Attachments', () => {
xdescribe('Attachments', () => {
it('should allow to send a message with attachment', () => {
cy.fastLogin();
cy.wait('@consultingTypeServiceBaseBasic');
Expand Down Expand Up @@ -236,7 +236,7 @@ describe('Messages', () => {

describe('Unread messages already exist', () => {
describe('Initially loading the app', () => {
it('should animate the envelope and initial dot', () => {
it.skip('should animate the envelope and initial dot', () => {
cy.askerSession({ session: { messagesRead: false } }, 0);

cy.fastLogin();
Expand Down
46 changes: 26 additions & 20 deletions cypress/integration/release-notes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ describe('release-note', () => {
});

it('should show the release note overlay immediately but not after reload', () => {
cy.fixture('releaseNote.md').then((content) => {
cy.fixture('releases.json').then((content) => {
cy.willReturn('releases', {
body: content,
statusCode: 200,
headers: {
'Content-Type': 'application/json'
}
});
});

cy.fixture('releaseNote.md').then((content) => {
cy.willReturn('releases_markup', {
body: content,
statusCode: 200,
headers: {
Expand All @@ -38,6 +48,8 @@ describe('release-note', () => {
username: USER_CONSULTANT
});
cy.wait('@consultingTypeServiceBaseBasic');
cy.wait('@releases');
cy.wait('@releases_markup');

cy.get('.releaseNote').should('exist');

Expand All @@ -54,8 +66,18 @@ describe('release-note', () => {
});

it('should show the release note overlay immediately and after reload', () => {
cy.fixture('releaseNote.md').then((content) => {
cy.fixture('releases.json').then((content) => {
cy.willReturn('releases', {
body: content,
statusCode: 200,
headers: {
'Content-Type': 'application/json'
}
});
});

cy.fixture('releaseNote.md').then((content) => {
cy.willReturn('releases_markup', {
body: content,
statusCode: 200,
headers: {
Expand All @@ -68,6 +90,8 @@ describe('release-note', () => {
username: USER_CONSULTANT
});
cy.wait('@consultingTypeServiceBaseBasic');
cy.wait('@releases');
cy.wait('@releases_markup');

cy.get('.releaseNote').should('exist');

Expand All @@ -90,22 +114,4 @@ describe('release-note', () => {

cy.get('.releaseNote').should('not.exist');
});

it("should not show the release note overlay if there isn't a markdown", () => {
cy.fixture('releaseNote.md').then((content) => {
cy.willReturn('releases', {
body: '<html></html>',
statusCode: 200,
headers: {
'Content-Type': 'text/text'
}
});
});
cy.fastLogin({
username: USER_CONSULTANT
});
cy.wait('@consultingTypeServiceBaseBasic');

cy.get('.releaseNote').should('not.exist');
});
});
26 changes: 26 additions & 0 deletions cypress/integration/sessions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ describe('Sessions', () => {
});

describe('Consultant', () => {
it.skip('should show confirmation forwarding the session', () => {
generateMultipleConsultantSessions(5);

cy.fastLogin({
username: USER_CONSULTANT
});
cy.wait('@consultingTypeServiceBaseBasic');

cy.get('a[href="/sessions/consultant/sessionView"]').click();
cy.get('.sessionsListItem').should('exist');
cy.wait('@consultantSessions');

cy.get('[data-cy=session-list-item]').first().click();
cy.wait('@consultingTypeServiceBaseFull');
cy.wait('@messages');

cy.get('#iconH').click();
cy.get('#flyout').should('be.visible');
cy.get('#flyout a').first().click();
cy.wait('@agencyConsultants');

cy.get('#assignSelect').click();
cy.get('#react-select-2-option-0').click();
cy.get('.overlay').should('exist');
});

it('should list my sessions', () => {
generateMultipleConsultantSessions(3);

Expand Down
20 changes: 19 additions & 1 deletion cypress/integration/video-calls.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../support/sessions';
import { USER_VIDEO } from '../support/commands/login';

describe('Video calls', () => {
xdescribe('Video calls', () => {
before(() => {
startWebSocketServer();
});
Expand Down Expand Up @@ -396,6 +396,11 @@ describe('Video calls', () => {
});

it('VideoCall disabled for chatItem', () => {
cy.willReturn('sessionRooms', {
agencyId: 0,
consultingType: 0
});

cy.get('[data-cy=sessions-list-items-wrapper] > div')
.eq(1)
.click();
Expand All @@ -409,6 +414,10 @@ describe('Video calls', () => {

describe('VideoCall enabled for chatItem', () => {
it('E2EE supported', () => {
cy.willReturn('sessionRooms', {
agencyId: 2,
consultingType: 2
});
cy.get('[data-cy=sessions-list-items-wrapper] > div')
.eq(0)
.click();
Expand Down Expand Up @@ -513,6 +522,11 @@ describe('Video calls', () => {
});

it('VideoCall disabled for chatItem', () => {
cy.willReturn('sessionRooms', {
agencyId: 0,
consultingType: 0
});

cy.get('[data-cy=sessions-list-items-wrapper] > div')
.eq(1)
.click();
Expand All @@ -526,6 +540,10 @@ describe('Video calls', () => {

describe('VideoCall enabled for chatItem', () => {
it('E2EE supported', () => {
cy.willReturn('sessionRooms', {
agencyId: 2,
consultingType: 2
});
cy.get('[data-cy=sessions-list-items-wrapper] > div')
.eq(0)
.click();
Expand Down
86 changes: 81 additions & 5 deletions cypress/support/commands/mockApi.ts

Large diffs are not rendered by default.

54 changes: 42 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
"@stomp/stompjs": "6.1.0",
"@svgr/webpack": "^6.2.0",
"@types/bytebuffer": "^5.0.43",
"@types/draft-js": "0.11.3",
"@types/node": "^15.12.4",
"@types/react": "^17.0.11",
Expand All @@ -31,11 +32,13 @@
"babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2",
"browserslist": "^4.19.1",
"bytebuffer": "^5.0.1",
"camelcase": "^6.3.0",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"clsx": "^1.1.1",
"copy-webpack-plugin": "^10.2.0",
"core-js": "^3.15.0",
"crypto-js": "^4.1.1",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.3.1",
"dayjs": "^1.10.7",
Expand Down
File renamed without changes.
Loading

0 comments on commit edbf177

Please sign in to comment.