test(harness): stabilize backend+frontend QA test suite (12/12+63/63 unit+integration, 45/45 frontend)
Stabilize test harness across full stack: Backend integration tests: - Fix Auth/Club/Migration/RLS/Member/Tenant/RLS Isolation/Shift/Task test suites - Add AssemblyInfo.cs for test configuration - Enhance CustomWebApplicationFactory + TestAuthHandler for stable test environment - Expand RlsIsolationTests with comprehensive multi-tenant RLS verification Frontend test harness: - Align vitest.config.ts with backend API changes - Add bunfig.toml for bun test environment stability - Enhance api.test.ts with proper test setup integration - Expand test/setup.ts with fixture initialization All tests now passing: backend 12/12 unit + 63/63 integration, frontend 45/45
This commit is contained in:
@@ -86,7 +86,6 @@ public class ShiftCrudTests : IntegrationTestBase
|
||||
[Fact]
|
||||
public async Task ListShifts_WithDateFilter_ReturnsFilteredShifts()
|
||||
{
|
||||
// Arrange
|
||||
var clubId = Guid.NewGuid();
|
||||
var createdBy = Guid.NewGuid();
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
@@ -95,7 +94,6 @@ public class ShiftCrudTests : IntegrationTestBase
|
||||
{
|
||||
var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
|
||||
// Shift in date range
|
||||
context.Shifts.Add(new Shift
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
@@ -110,7 +108,6 @@ public class ShiftCrudTests : IntegrationTestBase
|
||||
UpdatedAt = now
|
||||
});
|
||||
|
||||
// Shift outside date range
|
||||
context.Shifts.Add(new Shift
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
@@ -131,13 +128,11 @@ public class ShiftCrudTests : IntegrationTestBase
|
||||
SetTenant("tenant1");
|
||||
AuthenticateAs("member@test.com", new Dictionary<string, string> { ["tenant1"] = "Member" });
|
||||
|
||||
var from = now.AddDays(1).ToString("o");
|
||||
var to = now.AddDays(5).ToString("o");
|
||||
var from = Uri.EscapeDataString(now.AddDays(1).ToString("o"));
|
||||
var to = Uri.EscapeDataString(now.AddDays(5).ToString("o"));
|
||||
|
||||
// Act
|
||||
var response = await Client.GetAsync($"/api/shifts?from={from}&to={to}");
|
||||
|
||||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<ShiftListResponse>();
|
||||
|
||||
Reference in New Issue
Block a user