Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change incorrect example for staff development training category #6358

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { fireEvent, render } from '@testing-library/angular';
import { BehaviorSubject } from 'rxjs';
import { getTestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TrainingService } from '@core/services/training.service';
import { MockTrainingService, MockTrainingServiceWithPreselectedStaff } from '@core/test-utils/MockTrainingService';
import { getTestBed } from '@angular/core/testing';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { Establishment } from '@core/model/establishment.model';
import { BackLinkService } from '@core/services/backLink.service';
import { ErrorSummaryService } from '@core/services/error-summary.service';
import { GroupedRadioButtonAccordionComponent } from '@shared/components/accordions/radio-button-accordion/grouped-radio-button-accordion/grouped-radio-button-accordion.component';
import { RadioButtonAccordionComponent } from '@shared/components/accordions/radio-button-accordion/radio-button-accordion.component';
import { SharedModule } from '@shared/shared.module';
import { RouterTestingModule } from '@angular/router/testing';
import { TrainingService } from '@core/services/training.service';
import { WindowRef } from '@core/services/window.ref';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { WorkerService } from '@core/services/worker.service';
import { workerBuilder } from '@core/test-utils/MockWorkerService';
import { establishmentBuilder } from '@core/test-utils/MockEstablishmentService';
import { Establishment } from '@core/model/establishment.model';
import { SelectTrainingCategoryComponent } from './select-training-category.component';
import { trainingCategories } from '@core/test-utils/MockTrainingCategoriesService';
import { MockTrainingService, MockTrainingServiceWithPreselectedStaff } from '@core/test-utils/MockTrainingService';
import { workerBuilder } from '@core/test-utils/MockWorkerService';
import { GroupedRadioButtonAccordionComponent } from '@shared/components/accordions/radio-button-accordion/grouped-radio-button-accordion/grouped-radio-button-accordion.component';
import { RadioButtonAccordionComponent } from '@shared/components/accordions/radio-button-accordion/radio-button-accordion.component';
import { SharedModule } from '@shared/shared.module';
import { fireEvent, render } from '@testing-library/angular';
import { BehaviorSubject } from 'rxjs';
import sinon from 'sinon';

import { SelectTrainingCategoryComponent } from './select-training-category.component';

describe('SelectTrainingCategoryComponent', () => {
async function setup(prefill = false, qsParamGetMock = sinon.fake()) {
const establishment = establishmentBuilder() as Establishment;
Expand Down Expand Up @@ -195,4 +196,14 @@ describe('SelectTrainingCategoryComponent', () => {

expect(component.form.value).toEqual({ category: 1 });
});

it('should display example messages for each training group', async () => {
const { component, getByText } = await setup();

expect(getByText("Training like 'duty of care', 'safeguarding adults'")).toBeTruthy();
expect(getByText("Training like 'fire safety', 'first aid'")).toBeTruthy();
expect(getByText("Training like 'online safety and security', 'working with digital technology'")).toBeTruthy();
expect(getByText("Training like 'dementia care', 'Oliver McGowan Mandatory Training'")).toBeTruthy();
expect(getByText("Training like 'communication', 'leadership and management'")).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SelectTrainingCategoryDirective implements OnInit, AfterViewInit {
'Health and safety in the workplace': "'fire safety', 'first aid'",
'IT, digital and data in the workplace': "'online safety and security', 'working with digital technology'",
'Specific conditions and disabilities': "'dementia care', 'Oliver McGowan Mandatory Training'",
'Staff development': "'communication', 'equality and diversity'",
'Staff development': "'communication', 'leadership and management' ",
};
submitButtonText: string = 'Continue';

Expand Down
Loading