-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…1433) * Added restriction to screening participants and endpoints recently added, within an edit-hearing. Provided text to advise user to save booking first * edit hearing - logic flip * fixed assertion * Fixed broken test. Used wrong assertion, changed from toBe to toEqual * changed from sip to id * Implemented fix for VIH-11057 - external ref id not being mapped correctly for endpoints models, on preexisting endpoints. (cherry picked from commit f7489b8)
- Loading branch information
1 parent
63bf1bd
commit c23f317
Showing
20 changed files
with
228 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,8 @@ function initHearingRequest(): HearingModel { | |
pin: 'pin', | ||
username: '[email protected]', | ||
contactEmail: '[email protected]', | ||
interpretationLanguage: undefined | ||
interpretationLanguage: undefined, | ||
externalReferenceId: 'ex1' | ||
} | ||
]; | ||
return newHearing; | ||
|
@@ -212,7 +213,14 @@ describe('EndpointsComponent', () => { | |
featureServiceSpy.getFlag.withArgs(FeatureFlags.multiDayBookingEnhancements).and.returnValue(of(true)); | ||
component.ngOnInit(); | ||
component.videoEndpoints = [ | ||
{ id: '1', displayName: 'Test', defenceAdvocate: null, interpretationLanguage: undefined, screening: undefined } | ||
{ | ||
id: '1', | ||
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
} | ||
]; | ||
component.saveEndpoints(); | ||
expect(routerSpy.navigate).toHaveBeenCalledWith(['/other-information']); | ||
|
@@ -232,7 +240,8 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointAdded(endpoint); | ||
expect(component.videoEndpoints).toContain(endpoint); | ||
|
@@ -244,7 +253,8 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.videoEndpoints = [endpoint]; | ||
component.onEndpointAdded(endpoint); | ||
|
@@ -255,8 +265,22 @@ describe('EndpointsComponent', () => { | |
describe('onEndpointUpdated', () => { | ||
beforeEach(() => { | ||
component.videoEndpoints = [ | ||
{ id: '1', displayName: 'Test', defenceAdvocate: null, interpretationLanguage: undefined, screening: undefined }, | ||
{ id: '2', displayName: 'Test2', defenceAdvocate: null, interpretationLanguage: undefined, screening: undefined } | ||
{ | ||
id: '1', | ||
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}, | ||
{ | ||
id: '2', | ||
displayName: 'Test2', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
} | ||
]; | ||
}); | ||
|
||
|
@@ -266,15 +290,17 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.videoEndpoints = [endpoint]; | ||
const updatedEndpoint = { | ||
id: '1', | ||
displayName: 'Updated', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointUpdated({ original: endpoint, updated: updatedEndpoint }); | ||
expect(component.videoEndpoints).toContain(updatedEndpoint); | ||
|
@@ -286,14 +312,16 @@ describe('EndpointsComponent', () => { | |
displayName: 'DoesNotExist', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
const updatedEndpoint = { | ||
id: '1', | ||
displayName: 'Updated', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointUpdated({ original: endpoint, updated: updatedEndpoint }); | ||
expect(component.videoEndpoints).not.toContain(endpoint); | ||
|
@@ -303,8 +331,22 @@ describe('EndpointsComponent', () => { | |
describe('onEndpointSelectedForDeletion', () => { | ||
beforeEach(() => { | ||
component.videoEndpoints = [ | ||
{ id: '1', displayName: 'Test', defenceAdvocate: null, interpretationLanguage: undefined, screening: undefined }, | ||
{ id: '2', displayName: 'Test2', defenceAdvocate: null, interpretationLanguage: undefined, screening: undefined } | ||
{ | ||
id: '1', | ||
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}, | ||
{ | ||
id: '2', | ||
displayName: 'Test2', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
} | ||
]; | ||
}); | ||
|
||
|
@@ -314,7 +356,8 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointSelectedForDeletion(endpoint); | ||
expect(component.videoEndpoints).not.toContain(endpoint); | ||
|
@@ -326,7 +369,8 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test3', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointSelectedForDeletion(endpoint); | ||
expect(component.videoEndpoints.length).toBe(2); | ||
|
@@ -340,7 +384,8 @@ describe('EndpointsComponent', () => { | |
displayName: 'Test', | ||
defenceAdvocate: null, | ||
interpretationLanguage: undefined, | ||
screening: undefined | ||
screening: undefined, | ||
externalReferenceId: '1' | ||
}; | ||
component.onEndpointSelectedForEdit(endpoint); | ||
expect(component.videoEndpointToEdit).toBe(endpoint); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.