Skip to content

Commit

Permalink
Add NINO to User admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Jan 9, 2024
1 parent a6677c9 commit 23e4d27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
<govuk-summary-list-row-action asp-page="EditUserMobileNumber" asp-route-userId="@Model.UserId" visually-hidden-text="mobile number">Change</govuk-summary-list-row-action>
</govuk-summary-list-row-actions>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>National insurance number</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.NationalInsuranceNumber</govuk-summary-list-row-value>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Date of birth</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@(Model.DateOfBirth.HasValue ? Model.DateOfBirth.Value.ToString("d MMMM yyyy") : "")</govuk-summary-list-row-value>
Expand Down Expand Up @@ -131,7 +135,7 @@
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>National insurance number</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@(!string.IsNullOrEmpty(Model.DqtNationalInsuranceNumber) ? "Provided" : "Not provided")</govuk-summary-list-row-value>
<govuk-summary-list-row-value>@Model.DqtNationalInsuranceNumber</govuk-summary-list-row-value>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>TRN</govuk-summary-list-row-key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public UserModel(TeacherIdentityServerDbContext dbContext, IDqtApiClient dqtApiC

public DateOnly? DateOfBirth { get; set; }

public string? NationalInsuranceNumber { get; set; }

public string? DqtNationalInsuranceNumber { get; set; }

public string? Trn { get; set; }
Expand Down Expand Up @@ -70,6 +72,7 @@ public async Task<IActionResult> OnGet()
u.LastName,
u.PreferredName,
u.DateOfBirth,
u.NationalInsuranceNumber,
u.Trn,
u.Created,
u.UserType,
Expand Down Expand Up @@ -100,6 +103,7 @@ public async Task<IActionResult> OnGet()
CanChangeDqtRecord = !HaveDqtRecord;
MergedUserIds = user.MergedUserIds;
DateOfBirth = user.DateOfBirth;
NationalInsuranceNumber = user.NationalInsuranceNumber;
EffectiveVerificationLevel = user.EffectiveVerificationLevel;

if (user.Trn is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public async Task Get_ValidRequestForUserWithTrn_RendersExpectedContent()
Assert.NotNull(doc.GetElementByTestId("DqtSection"));
Assert.Equal($"{dqtFirstName} {dqtLastName}", doc.GetSummaryListValueForKey("DQT name"));
Assert.Equal(dqtDateOfBirth.ToString("d MMMM yyyy"), doc.GetElementByTestId("DqtSection")?.GetSummaryListValueForKey("Date of birth"));
Assert.Equal("Provided", doc.GetSummaryListValueForKey("National insurance number"));
Assert.Equal(dqtNino, doc.GetSummaryListValueForKey("National insurance number"));

Check failure on line 123 in dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/EndpointTests/Admin/UserTests.cs

View workflow job for this annotation

GitHub Actions / Unit test results

TeacherIdentity.AuthServer.Tests.EndpointTests.Admin.UserTests ► Get_ValidRequestForUserWithTrn_RendersExpectedContent

Failed test found in: dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/TestResults/_fv-az1240-349_2024-01-09_17_23_29.trx Error: Assert.Equal() Failure: Strings differ ↓ (pos 0) Expected: "KW726455C" Actual: ""
Raw output
Assert.Equal() Failure: Strings differ
           ↓ (pos 0)
Expected: "KW726455C"
Actual:   ""
   at TeacherIdentity.AuthServer.Tests.EndpointTests.Admin.UserTests.Get_ValidRequestForUserWithTrn_RendersExpectedContent() in /home/runner/work/get-an-identity/get-an-identity/dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/EndpointTests/Admin/UserTests.cs:line 123
Assert.Equal(user.Trn, doc.GetSummaryListValueForKey("TRN"));
}

Expand Down

0 comments on commit 23e4d27

Please sign in to comment.