fix: close release preflight gaps
Route public health checks to the API, backfill and synchronize job opportunities, stabilize SPA smoke tests, and document operator-only production steps.
This commit is contained in:
@@ -816,6 +816,10 @@ public sealed class GmailControllerTests
|
||||
Assert.Equal(1, created.Imported);
|
||||
Assert.Equal("thread-suggested", created.ThreadId);
|
||||
Assert.Equal(1, await db.JobApplications.CountAsync());
|
||||
var linkedOpportunity = await db.JobApplications.Include(application => application.Job).SingleAsync();
|
||||
Assert.NotNull(linkedOpportunity.JobId);
|
||||
Assert.Equal("Platform Engineer", linkedOpportunity.Job!.JobTitle);
|
||||
Assert.Equal("gmail", linkedOpportunity.Job.Source);
|
||||
Assert.Equal(1, await db.Correspondences.CountAsync());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using JobTrackerApi.Models;
|
||||
using JobTrackerApi.Services;
|
||||
using JobTrackerApi.Tests.TestSupport;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Xunit;
|
||||
|
||||
namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class JobOpportunitySyncTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Backfill_links_each_legacy_application_once()
|
||||
{
|
||||
await using var db = TestHostFactory.CreateInMemoryDb();
|
||||
var company = new Company { OwnerUserId = "user-1", Name = "Acme" };
|
||||
db.Companies.Add(company);
|
||||
await db.SaveChangesAsync();
|
||||
db.JobApplications.Add(new JobApplication
|
||||
{
|
||||
OwnerUserId = "user-1",
|
||||
CompanyId = company.Id,
|
||||
JobTitle = "Platform Engineer",
|
||||
Location = "Oslo",
|
||||
SavedAt = new DateTime(2026, 7, 1, 10, 0, 0, DateTimeKind.Utc),
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
Assert.Equal(1, await JobOpportunitySync.BackfillLegacyAsync(db));
|
||||
Assert.Equal(0, await JobOpportunitySync.BackfillLegacyAsync(db));
|
||||
|
||||
var application = await db.JobApplications.IgnoreQueryFilters().Include(item => item.Job).SingleAsync();
|
||||
Assert.NotNull(application.JobId);
|
||||
Assert.Equal("Platform Engineer", application.Job!.JobTitle);
|
||||
Assert.Equal("Oslo", application.Job.Location);
|
||||
Assert.Equal("legacy", application.Job.Source);
|
||||
Assert.Equal(1, await db.Jobs.IgnoreQueryFilters().CountAsync());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user