feat(jobs): complete workspace draft parity
This commit is contained in:
@@ -225,7 +225,7 @@ public sealed class JobApplicationsEndpointBehaviorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Update_drops_invalid_salary_period_and_negative_values()
|
||||
public async Task Update_normalizes_salary_and_preserves_the_separate_application_answer()
|
||||
{
|
||||
await using var db = CreateDb();
|
||||
var company = new Company { Name = "Acme", OwnerUserId = "user-1" };
|
||||
@@ -241,6 +241,7 @@ public sealed class JobApplicationsEndpointBehaviorTests
|
||||
SalaryMax = 60000m,
|
||||
SalaryCurrency = "NOK",
|
||||
SalaryPeriod = "year",
|
||||
Notes = "Old human note\n\n<<<APPLICATION_ANSWER_DRAFT>>>\nSaved answer\n<<<END_APPLICATION_ANSWER_DRAFT>>>",
|
||||
Job = new Job { CompanyId = company.Id, JobTitle = "Backend Dev", Source = "nav", CountryCode = "NO" },
|
||||
};
|
||||
db.JobApplications.Add(job);
|
||||
@@ -261,7 +262,7 @@ public sealed class JobApplicationsEndpointBehaviorTests
|
||||
SalaryPeriod: "fortnight",
|
||||
NextAction: null,
|
||||
FollowUpAt: null,
|
||||
Notes: null,
|
||||
Notes: "Updated human note",
|
||||
Description: null,
|
||||
TranslatedDescription: null,
|
||||
DescriptionLanguage: null,
|
||||
@@ -281,6 +282,8 @@ public sealed class JobApplicationsEndpointBehaviorTests
|
||||
Assert.Null(saved.SalaryMax);
|
||||
Assert.Null(saved.SalaryCurrency);
|
||||
Assert.Null(saved.SalaryPeriod);
|
||||
Assert.Equal("Updated human note", JobApplicationHelpers.RemoveSavedApplicationAnswerDraft(saved.Notes));
|
||||
Assert.Equal("Saved answer", JobApplicationHelpers.ExtractSavedApplicationAnswerDraft(saved.Notes));
|
||||
var opportunity = await db.Jobs.SingleAsync();
|
||||
Assert.Equal(saved.JobTitle, opportunity.JobTitle);
|
||||
Assert.Null(opportunity.SalaryMin);
|
||||
|
||||
Reference in New Issue
Block a user