From 38c78163084a7a4b37b22d69ce47065acf3c0249 Mon Sep 17 00:00:00 2001 From: Duncan Carter Date: Thu, 12 Sep 2024 16:52:47 +0100 Subject: [PATCH] Change incorrect example for staff development training category --- ...select-training-category.component.spec.ts | 37 ++++++++++++------- .../select-training-category.directive.ts | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/features/training-and-qualifications/add-edit-training/select-training-category/select-training-category.component.spec.ts b/frontend/src/app/features/training-and-qualifications/add-edit-training/select-training-category/select-training-category.component.spec.ts index d008190e28..82c1a8aa04 100644 --- a/frontend/src/app/features/training-and-qualifications/add-edit-training/select-training-category/select-training-category.component.spec.ts +++ b/frontend/src/app/features/training-and-qualifications/add-edit-training/select-training-category/select-training-category.component.spec.ts @@ -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; @@ -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(); + }); }); diff --git a/frontend/src/app/shared/directives/select-training-category/select-training-category.directive.ts b/frontend/src/app/shared/directives/select-training-category/select-training-category.directive.ts index 0610217729..5084312b65 100644 --- a/frontend/src/app/shared/directives/select-training-category/select-training-category.directive.ts +++ b/frontend/src/app/shared/directives/select-training-category/select-training-category.directive.ts @@ -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';