diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/PageObjects/RecordDecisionWizard.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/PageObjects/RecordDecisionWizard.cs index 17183b3f9..c29c174ab 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/PageObjects/RecordDecisionWizard.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/PageObjects/RecordDecisionWizard.cs @@ -29,6 +29,7 @@ public async Task SubmitThroughTheWizard(AdvisoryBoardDecision request) { await SetDecisionToAndContinue(request.Decision.GetValueOrDefault()); await SetDecisionByAndContinue(request.DecisionMadeBy.GetValueOrDefault()); + await SetDecisionMakerName("Tester"); await SetIsConditionalAndContinue(request.ApprovedConditionsSet.GetValueOrDefault(), request.ApprovedConditionsDetails); await SetDecisionDateAndContinue(request.AdvisoryBoardDecisionDate.GetValueOrDefault(DateTime.MinValue)); } @@ -62,6 +63,12 @@ public async Task SetDecisionByAndContinue(DecisionMadeBy by) await ClickSubmitButton(); } + public async Task SetDecisionMakerName(string by) + { + Document.QuerySelector($"#decision-maker-name")!.Value = by; + await ClickSubmitButton(); + } + public async Task SetDeclinedReasonsAndContinue(Tuple reason, params Tuple[] furtherReasons) { foreach ((AdvisoryBoardDeclinedReasons option, string detail) in new[] { reason }.Concat(furtherReasons)) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/AnyConditionsIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/AnyConditionsIntegrationTests.cs index 759c33cf8..08e57dbb7 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/AnyConditionsIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/AnyConditionsIntegrationTests.cs @@ -29,6 +29,7 @@ public async Task InitializeAsync() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Approved); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await _wizard.SetDecisionMakerName("Tester"); Document.Url.Should().EndWith("any-conditions"); } @@ -38,14 +39,6 @@ public Task DisposeAsync() return Task.CompletedTask; } - [Fact] - public void Should_display_selected_school_name() - { - string selectedSchool = Document.QuerySelector("#selection-span")?.Text(); - - selectedSchool.Should().Be(_project.SchoolName); - } - [Fact] public async Task Should_persist_selected_decision() { diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/ChangeDecisionOptionsIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/ChangeDecisionOptionsIntegrationTests.cs index c74c95e2b..d45b4f5dd 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/ChangeDecisionOptionsIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/ChangeDecisionOptionsIntegrationTests.cs @@ -97,7 +97,7 @@ public async Task Should_pass_on_the_obl_parameter_when_changing_whether_the_acc await _wizard.StartFor(_project.Id); await _wizard.SubmitThroughTheWizard(decision); - await NavigateAsync("Change", 2); + await NavigateAsync("Change", 3); PageHeading.Should().Be("Were any conditions set?"); Document.Url.Should().Contain("obl="); @@ -113,9 +113,10 @@ public async Task Should_pass_on_the_obl_parameter_when_changing_declined_reason await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Other, "other")); await _wizard.SetDecisionDateAndContinue(DateTime.Today); - await NavigateAsync("Change", 2); + await NavigateAsync("Change", 3); PageHeading.Should().Be("Why was this project declined?"); Document.Url.Should().Contain("obl="); @@ -131,9 +132,10 @@ public async Task Should_pass_on_the_obl_parameter_when_changing_deferred_reason await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Deferred); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.DirectorGeneral); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeferredReasonsAndContinue(Tuple.Create(AdvisoryBoardDeferredReason.Other, "other")); await _wizard.SetDecisionDateAndContinue(DateTime.Today); - await NavigateAsync("Change", 2); + await NavigateAsync("Change", 3); PageHeading.Should().Be("Why was this project deferred?"); Document.Url.Should().Contain("obl="); diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DecisionDateIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DecisionDateIntegrationTests.cs index 82c37ae7f..07b820469 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DecisionDateIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DecisionDateIntegrationTests.cs @@ -22,18 +22,6 @@ public DecisionDateIntegrationTests(IntegrationTestingWebApplicationFactory fact private IHtmlInputElement MonthPart => Document.QuerySelector("#decision-date-month"); private IHtmlInputElement YearPart => Document.QuerySelector("#decision-date-year"); - [Fact] - public async Task Should_display_selected_school_name() - { - AcademyConversionProject project = AddGetProject(p => p.SchoolOverviewSectionComplete = false); - - await ProgressToDecisionDateStep(project); - - string selectedSchool = Document.QuerySelector("#selection-span")!.Text(); - - selectedSchool.Should().Be(project.SchoolName); - } - [Fact] public async Task Should_persist_approval_date() { @@ -139,6 +127,7 @@ public async Task Should_go_back_to_declined_reasons_for_the_declined_journey() await wizard.StartFor(project.Id); await wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await wizard.SetDecisionMakerName("Tester"); await wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Finance, "Finance reasons")); PageHeading.Should().Be("Date conversion was declined"); @@ -162,6 +151,7 @@ public async Task Should_display_the_correct_journey_in_the_required_message_whe await wizard.StartFor(project.Id); await wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await wizard.SetDecisionMakerName("Tester"); await wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Performance, "performance reasons")); PageHeading.Should().Be("Date conversion was declined"); @@ -185,6 +175,7 @@ private async Task ProgressToDecisionDateStep(AcademyConversionProject project) await wizard.StartFor(project.Id); await wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Approved); await wizard.SetDecisionByAndContinue(DecisionMadeBy.OtherRegionalDirector); + await wizard.SetDecisionMakerName("Tester"); await wizard.SetIsConditionalAndContinue(false, "Something"); } } diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DeclineReasonIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DeclineReasonIntegrationTests.cs index 146450d93..9bdfc76ac 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DeclineReasonIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/DeclineReasonIntegrationTests.cs @@ -31,6 +31,7 @@ public async Task InitializeAsync() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.RegionalDirectorForRegion); + await _wizard.SetDecisionMakerName("Tester"); Document.Url.Should().EndWith("/decision/declined-reason"); } @@ -40,15 +41,6 @@ public Task DisposeAsync() return Task.CompletedTask; } - - [Fact] - public void Should_display_the_selected_school_name() - { - string selectedSchool = Document.QuerySelector("#selection-span")!.Text(); - - selectedSchool.Should().Be(_project.SchoolName); - } - [Fact] public async Task Should_return_to_the_who_made_this_decision_page_when_back_link_is_clicked() { diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/RecordDecisionIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/RecordDecisionIntegrationTests.cs index 4fd43daa4..da93c375f 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/RecordDecisionIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/RecordDecisionIntegrationTests.cs @@ -14,18 +14,6 @@ public RecordDecisionIntegrationTests(IntegrationTestingWebApplicationFactory fa { } - [Fact] - public async Task Should_display_selected_schoolname() - { - AcademyConversionProject project = AddGetProject(p => p.SchoolOverviewSectionComplete = false); - - await OpenAndConfirmPathAsync($"/task-list/{project.Id}/decision/record-decision"); - - string selectedSchool = Document.QuerySelector("#selection-span")!.Text(); - - selectedSchool.Should().Be(project.SchoolName); - } - [Fact] public async Task Should_persist_selected_decision() { diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/SummaryIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/SummaryIntegrationTests.cs index a05cb1542..941b71625 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/SummaryIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/SummaryIntegrationTests.cs @@ -37,6 +37,7 @@ public async Task Should_redirect_to_task_list() ApprovedConditionsSet = true, ApprovedConditionsDetails = "bills need to be paid", DecisionMadeBy = DecisionMadeBy.DirectorGeneral, + DecisionMakerName = "Tester", ConversionProjectId = _project.Id }; @@ -52,29 +53,6 @@ public async Task Should_redirect_to_task_list() PageSubHeading.Should().Be("Prepare a project document"); } - [Fact] - public async Task Should_display_selected_school_name() - { - AdvisoryBoardDecision request = new() - { - Decision = AdvisoryBoardDecisions.Approved, - AdvisoryBoardDecisionDate = new DateTime(2021, 01, 01), - ApprovedConditionsSet = true, - ApprovedConditionsDetails = "bills need to be paid", - DecisionMadeBy = DecisionMadeBy.DirectorGeneral, - ConversionProjectId = _project.Id - }; - - _factory.AddPostWithJsonRequest("/conversion-project/advisory-board-decision", request, ""); - - await OpenAndConfirmPathAsync($"/task-list/{_project.Id}/decision/record-decision"); - - await _wizard.SubmitThroughTheWizard(request); - - Document.QuerySelector("#selection-span")!.Text().Should() - .Be(_project.SchoolName); - } - [Fact] public async Task Should_populate_summary_and_create_new_decision() { @@ -85,6 +63,7 @@ public async Task Should_populate_summary_and_create_new_decision() ApprovedConditionsSet = true, ApprovedConditionsDetails = "bills need to be paid", DecisionMadeBy = DecisionMadeBy.DirectorGeneral, + DecisionMakerName = "Tester", ConversionProjectId = _project.Id }; @@ -109,6 +88,7 @@ public async Task Should_populate_summary_and_save_existing_decision() ApprovedConditionsSet = true, ApprovedConditionsDetails = "bills need to be paid", DecisionMadeBy = DecisionMadeBy.DirectorGeneral, + DecisionMakerName = "Tester", ConversionProjectId = _project.Id }; @@ -159,6 +139,7 @@ public async Task Should_display_declined_for_declined_projects() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.DirectorGeneral); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Finance, "Finance reason")); await _wizard.SetDecisionDateAndContinue(DateTime.Today); @@ -171,6 +152,7 @@ public async Task Should_show_the_selected_decline_reasons_and_details() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Finance, "Finance detail"), Tuple.Create(AdvisoryBoardDeclinedReasons.ChoiceOfTrust, "Choice of trust detail")); await _wizard.SetDecisionDateAndContinue(DateTime.Today); @@ -193,6 +175,7 @@ public async Task Should_show_the_selected_deferred_reasons_and_details() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Deferred); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeferredReasonsAndContinue( Tuple.Create(AdvisoryBoardDeferredReason.PerformanceConcerns, "Performance detail"), Tuple.Create(AdvisoryBoardDeferredReason.Other, "Other detail"), @@ -218,6 +201,7 @@ public async Task Should_not_display_conditions_details_for_declined_projects() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.OtherRegionalDirector); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeclinedReasonsAndContinue(Tuple.Create(AdvisoryBoardDeclinedReasons.Finance, "finance reasons")); await _wizard.SetDecisionDateAndContinue(DateTime.Today); @@ -228,8 +212,8 @@ public async Task Should_not_display_conditions_details_for_declined_projects() [Theory] [InlineData(1, "Who made this decision?")] - [InlineData(2, "Were any conditions set?")] - [InlineData(3, "Date conversion was approved")] + [InlineData(3, "Were any conditions set?")] + [InlineData(4, "Date conversion was approved")] public async Task Should_go_back_to_choose_and_back_link_to_summary(int changeLinkIndex, string expectedTitle) { AdvisoryBoardDecision request = new() @@ -258,9 +242,9 @@ public async Task Should_go_back_to_choose_and_back_link_to_summary(int changeLi [Theory] [InlineData(0, "Record the decision", "Who made this decision?")] - [InlineData(1, "Who made this decision?", "Were any conditions set?")] - [InlineData(2, "Were any conditions set?", "Date conversion was approved")] - [InlineData(3, "Date conversion was approved", "Check your answers before recording this decision")] + [InlineData(1, "Who made this decision?", "Decision maker's name")] + [InlineData(3, "Were any conditions set?", "Date conversion was approved")] + [InlineData(4, "Date conversion was approved", "Check your answers before recording this decision")] public async Task Should_go_back_to_choose_and_submit_back_to_summary(int changeLinkIndex, string changePageTitle, string nextPageTitle) { AdvisoryBoardDecision request = new() @@ -292,6 +276,7 @@ public async Task Should_store_the_reasons_in_the_expected_order() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.Minister); + await _wizard.SetDecisionMakerName("Tester"); await _wizard.SetDeclinedReasonsAndContinue( Tuple.Create(AdvisoryBoardDeclinedReasons.ChoiceOfTrust, "trust"), Tuple.Create(AdvisoryBoardDeclinedReasons.Other, "other"), diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhoDecidedIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhoDecidedIntegrationTests.cs index 80db0054b..e89d631f4 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhoDecidedIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhoDecidedIntegrationTests.cs @@ -15,17 +15,6 @@ public WhoDecidedIntegrationTests(IntegrationTestingWebApplicationFactory factor { } - [Fact] - public async Task Should_display_selected_schoolname() - { - AcademyConversionProject project = AddGetProject(p => p.SchoolOverviewSectionComplete = false); - - await OpenAndConfirmPathAsync($"/task-list/{project.Id}/decision/who-decided"); - - string selectedSchool = Document.QuerySelector("#selection-span")!.Text(); - - selectedSchool.Should().Be(project.SchoolName); - } [Fact] public async Task Should_persist_who_decided() @@ -79,6 +68,7 @@ public async Task Should_redirect_to_decline_reasons_if_project_declined() await wizard.StartFor(project.Id); await wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Declined); await wizard.SetDecisionByAndContinue(DecisionMadeBy.RegionalDirectorForRegion); + await wizard.SetDecisionMakerName("Tester"); Document.Url.Should().EndWith("/decision/declined-reason", "reason should be the second question in the declined journey"); Document.QuerySelector(".govuk-fieldset__heading")!.TextContent.Trim() diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhyDeferredIntegrationTests.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhyDeferredIntegrationTests.cs index b1361815d..0b22baadf 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhyDeferredIntegrationTests.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Tests/Pages/TaskList/Decision/WhyDeferredIntegrationTests.cs @@ -35,18 +35,11 @@ public async Task InitializeAsync() await _wizard.StartFor(_project.Id); await _wizard.SetDecisionToAndContinue(AdvisoryBoardDecisions.Deferred); await _wizard.SetDecisionByAndContinue(DecisionMadeBy.RegionalDirectorForRegion); + await _wizard.SetDecisionMakerName("Tester"); Document.Url.Should().EndWith("/decision/why-deferred"); } - [Fact] - public void Should_display_the_selected_school_name() - { - string selectedSchool = Document.QuerySelector("#selection-span")!.Text(); - - selectedSchool.Should().Be(_project.SchoolName); - } - [Fact] public async Task Should_return_to_the_who_made_this_decision_page_when_back_link_is_clicked() {