Skip to content

Commit

Permalink
Merge pull request #6358 from NMDSdevopsServiceAdm/fix/summary-text-f…
Browse files Browse the repository at this point in the history
…or-staff-development-training-category

Change incorrect example for staff development training category
  • Loading branch information
duncanc19 authored Sep 13, 2024
2 parents 0179c49 + 38c7816 commit 2727b37
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
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

0 comments on commit 2727b37

Please sign in to comment.