Skip to content

Commit

Permalink
Communication: Enable code of conduct when communication is enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sarpsahinalp authored May 17, 2024
1 parent 7f31ba0 commit b48bcbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h5>
ngbTooltip="{{ 'artemisApp.course.courseCommunicationSetting.messagingEnabled.tooltip' | artemisTranslate }}"
/>
</div>
@if (messagingEnabled) {
@if (messagingEnabled || communicationEnabled) {
<div class="form-group">
<label class="form-control-label" jhiTranslate="artemisApp.codeOfConduct.title"></label>
<jhi-help-icon text="artemisApp.codeOfConduct.tooltip" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ describe('Course Management Update Component', () => {
comp.updateCourseInformationSharingMessagingCodeOfConduct('# Code of Conduct');
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].value).toBe('# Code of Conduct');
});

it('should update course information sharing code of conduct when communication is enabled and messaging disabled', () => {
comp.communicationEnabled = true;
comp.messagingEnabled = false;
comp.course = new Course();
comp.courseForm = new FormGroup({
courseInformationSharingMessagingCodeOfConduct: new FormControl(),
});
comp.updateCourseInformationSharingMessagingCodeOfConduct('# Code of Conduct');
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].value).toBe('# Code of Conduct');
// Verify the form control is editable
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].enabled).toBeTrue();
});
});

describe('changeComplaintsEnabled', () => {
Expand Down

0 comments on commit b48bcbc

Please sign in to comment.