Skip to content

Commit

Permalink
Merge pull request #1007 from DFE-Digital/feature/Correct-isdao
Browse files Browse the repository at this point in the history
IsDAO uses correct flag now
  • Loading branch information
dneed-nimble authored Mar 13, 2024
2 parents c25e247 + 36c531e commit 7668a23
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ public async Task Should_navigate_between_task_list_and_school_and_trust_informa
[Fact]
public async Task Should_display_the_dao_pack_sent_date_row_if_the_project_is_a_directed_academy_order()
{
AcademyConversionProject project = AddGetProject(project => project.ApplicationReceivedDate = null);
AcademyConversionProject project = AddGetProject(project =>
{
project.ApplicationReceivedDate = null;
project.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored;
});

await OpenAndConfirmPathAsync($"/task-list/{project.Id}");
await NavigateAsync("Conversion details");
Expand All @@ -232,6 +236,7 @@ public async Task Should_display_empty_for_the_dao_date_if_it_has_not_been_provi
AcademyConversionProject project = AddGetProject(project =>
{
project.ApplicationReceivedDate = null;
project.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored;
project.DaoPackSentDate = null;
});

Expand All @@ -249,6 +254,7 @@ public async Task Should_display_the_dao_pack_sent_date_if_it_has_been_provided(
AcademyConversionProject project = AddGetProject(project =>
{
project.ApplicationReceivedDate = null;
project.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored;
project.DaoPackSentDate = yesterday;
});

Expand All @@ -273,7 +279,13 @@ public async Task Should_not_display_the_dao_pack_sent_date_row_if_the_project_i
[Fact]
public async Task Should_navigate_to_dao_pack_sent_date_edit_screen_when_the_change_link_is_clicked()
{
AcademyConversionProject project = AddGetProject(project => project.ApplicationReceivedDate = null);
AcademyConversionProject project = AddGetProject(project =>
{
project.ApplicationReceivedDate = null;
project.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored;
}
);


await OpenAndConfirmPathAsync($"/task-list/{project.Id}");
await NavigateAsync("Conversion details");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ public Form7ReceivedIntegrationTests(IntegrationTestingWebApplicationFactory fac
[Fact]
public async Task Should_navigate_to_and_update_form_7_received()
{
AcademyConversionProject project = AddGetProject(p => p.ApplicationReceivedDate = null);
AcademyConversionProject project = AddGetProject(p =>
{
p.ApplicationReceivedDate = null;
p.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored;
});
AddPatchConfiguredProject(project, x =>
{
x.Form7Received = "Yes";
x.Urn = project.Urn;
});

await OpenAndConfirmPathAsync($"/task-list/{project.Id}/conversion-details");
await NavigateAsync("Change", 0);
await NavigateAsync("Change", 1);

Document.Url.Should().BeUrl($"/task-list/{project.Id}/confirm-school-trust-information-project-dates/form-7-received");
// Do the input boxes on the page default to none selected when coming from an empty value
Expand All @@ -48,15 +52,15 @@ public async Task Should_navigate_to_and_update_form_7_received()
[Fact]
public async Task Should_show_error_summary_when_there_is_an_API_error()
{
AcademyConversionProject project = AddGetProject(p => p.ApplicationReceivedDate = null);
AcademyConversionProject project = AddGetProject(p => { p.ApplicationReceivedDate = null; p.AcademyTypeAndRoute = AcademyTypeAndRoutes.Sponsored; });
AddPatchConfiguredProject(project, x =>
{
x.Form7Received = "Yes";
x.Urn = project.Urn;
});

await OpenAndConfirmPathAsync($"/task-list/{project.Id}/conversion-details");
await NavigateAsync("Change", 0);
await NavigateAsync("Change", 1);

Document.Url.Should().BeUrl($"/task-list/{project.Id}/confirm-school-trust-information-project-dates/form-7-received");
// Do the input boxes on the page default to none selected when coming from an empty value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<IViewComponentResult> InvokeAsync()
SchoolAndTrustInformationViewModel viewModel = new()
{
Id = project.Id.ToString(),
IsDao = project.ApplicationReceivedDate is null,
IsDao = project.AcademyTypeAndRoute is AcademyTypeAndRoutes.Sponsored,
RecommendationForProject = project.RecommendationForProject,
Author = project.Author,
ClearedBy = project.ClearedBy,
Expand Down

0 comments on commit 7668a23

Please sign in to comment.