-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/single-choice-field-type
- Loading branch information
Showing
129 changed files
with
6,607 additions
and
3,957 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
Frontend/CO.CDP.OrganisationApp.Tests/Pages/ApiKeyManagement/CreateApiKeyTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,14 @@ public void SetAnswer_SetsExpectedTextInput(string? input, string? expected) | |
} | ||
|
||
[Theory] | ||
[InlineData(true, null, "All information is required on this page")] | ||
[InlineData(true, " ", "All information is required on this page")] | ||
[InlineData(false, null, null)] | ||
[InlineData(false, "Some value", null)] | ||
public void Validate_ReturnsExpectedResults(bool isRequired, string? textInput, string? expectedErrorMessage) | ||
[InlineData(true, null, null, "Enter a value")] | ||
[InlineData(true, null, " ", "Enter a value")] | ||
[InlineData(false, false, null, null)] | ||
[InlineData(false, true, "Some value", null)] | ||
public void Validate_ReturnsExpectedResults(bool isRequired, bool? hasValue, string? textInput, string? expectedErrorMessage) | ||
{ | ||
_model.IsRequired = isRequired; | ||
_model.HasValue = hasValue; | ||
_model.CurrentFormQuestionType = FormQuestionType.Text; | ||
_model.TextInput = textInput; | ||
|
||
|
@@ -85,7 +86,7 @@ public void Validate_ReturnsExpectedResults(bool isRequired, string? textInput, | |
[InlineData("[email protected]", null)] | ||
public void Validate_EmailValidation_ReturnsExpectedResults(string? email, string? expectedErrorMessage) | ||
{ | ||
_model.IsRequired = false; | ||
_model.IsRequired = true; | ||
_model.CurrentFormQuestionType = FormQuestionType.Text; | ||
_model.Heading = "Email Address"; | ||
_model.TextInput = email; | ||
|
@@ -104,15 +105,16 @@ public void Validate_EmailValidation_ReturnsExpectedResults(string? email, strin | |
} | ||
|
||
[Theory] | ||
[InlineData(true, "Email Address", null, "All information is required on this page")] | ||
[InlineData(true, "Email Address", "invalid-email", "Enter an email address in the correct format, like [email protected].")] | ||
[InlineData(true, "Email Address", "[email protected]", null)] | ||
[InlineData(false, "Email Address", "somevalue", "Enter an email address in the correct format, like [email protected].")] | ||
[InlineData(false, "Email Address", null, null)] | ||
[InlineData(false, "Name", "invalid-email", null)] | ||
public void Validate_EmailFieldValidationBasedOnHeading_ReturnsExpectedResults(bool isRequired, string heading, string? textInput, string? expectedErrorMessage) | ||
[InlineData(true, null, "Email Address", null, "Enter an email address in the correct format, like [email protected].")] | ||
[InlineData(true, null, "Email Address", "invalid-email", "Enter an email address in the correct format, like [email protected].")] | ||
[InlineData(true, null, "Email Address", "[email protected]", null)] | ||
[InlineData(false, true, "Email Address", "somevalue", "Enter an email address in the correct format, like [email protected].")] | ||
[InlineData(false, false, "Email Address", null, null)] | ||
[InlineData(false, true, "Name", "invalid-email", null)] | ||
public void Validate_EmailFieldValidationBasedOnHeading_ReturnsExpectedResults(bool isRequired, bool? hasValue, string heading, string? textInput, string? expectedErrorMessage) | ||
{ | ||
_model.IsRequired = isRequired; | ||
_model.HasValue = hasValue; | ||
_model.CurrentFormQuestionType = FormQuestionType.Text; | ||
_model.Heading = heading; | ||
_model.TextInput = textInput; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
Frontend/CO.CDP.OrganisationApp.Tests/Pages/Organisation/OrganisationNameModelTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
...CO.CDP.OrganisationApp.Tests/Pages/Organisation/OrganisationRegisteredAddressModelTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
Frontend/CO.CDP.OrganisationApp.Tests/Pages/Registration/OrganisationNameModelTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
using CO.CDP.Organisation.WebApiClient; | ||
using CO.CDP.OrganisationApp.Pages.Supplier; | ||
using FluentAssertions; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Moq; | ||
using OrganisationWebApiClient = CO.CDP.Organisation.WebApiClient; | ||
|
||
namespace CO.CDP.OrganisationApp.Tests.Pages.Supplier.ConnectedEntity; | ||
|
||
|
@@ -110,38 +108,4 @@ private ConnectedEntityState DummyConnectedPersonDetails() | |
|
||
return connectedPersonDetails; | ||
} | ||
|
||
private static List<ConnectedEntityLookup> ConnectedEntities => | ||
[ | ||
new(Guid.NewGuid(), ConnectedEntityType.Organisation, "e1", It.IsAny<Uri>()), | ||
new(Guid.NewGuid(), ConnectedEntityType.Organisation, "e2", It.IsAny<Uri>()), | ||
]; | ||
|
||
private static SupplierInformation SupplierInformationClientModel => new( | ||
organisationName: "FakeOrg", | ||
supplierType: SupplierType.Organisation, | ||
operationTypes: null, | ||
completedRegAddress: true, | ||
completedPostalAddress: false, | ||
completedVat: false, | ||
completedWebsiteAddress: false, | ||
completedEmailAddress: true, | ||
completedQualification: false, | ||
completedTradeAssurance: false, | ||
completedOperationType: false, | ||
completedLegalForm: false, | ||
completedConnectedPerson: false, | ||
tradeAssurances: null, | ||
legalForm: null, | ||
qualifications: null); | ||
|
||
private static OrganisationWebApiClient.Organisation OrganisationClientModel(Guid id) => | ||
new( | ||
additionalIdentifiers: [new Identifier(id: "FakeId", legalName: "FakeOrg", scheme: "VAT", uri: null)], | ||
addresses: null, | ||
contactPoint: new ContactPoint(email: "[email protected]", name: null, telephone: null, url: new Uri("https://xyz.com")), | ||
id: id, | ||
identifier: null, | ||
name: "Test Org", | ||
roles: [PartyRole.Supplier]); | ||
} |
Oops, something went wrong.