Refactor Home UI controls and add dice to campaign log entries
This commit is contained in:
@@ -60,13 +60,16 @@ public sealed class RollVisibilityApiTests : ApiTestBase
|
||||
|
||||
var gmLog = await GetAsync<IReadOnlyList<CampaignLogEntry>>(gmClient, $"/api/campaigns/{campaign.Id}/log");
|
||||
Assert.Equal(2, gmLog.Count);
|
||||
Assert.All(gmLog, entry => Assert.NotEmpty(entry.Dice));
|
||||
|
||||
var playerLog = await GetAsync<IReadOnlyList<CampaignLogEntry>>(playerClient, $"/api/campaigns/{campaign.Id}/log");
|
||||
Assert.Equal(2, playerLog.Count);
|
||||
Assert.All(playerLog, entry => Assert.NotEmpty(entry.Dice));
|
||||
|
||||
var observerLog = await GetAsync<IReadOnlyList<CampaignLogEntry>>(observerClient, $"/api/campaigns/{campaign.Id}/log");
|
||||
Assert.Single(observerLog);
|
||||
Assert.Equal("public", observerLog[0].Visibility);
|
||||
Assert.NotEmpty(observerLog[0].Dice);
|
||||
|
||||
await RegisterAsync(outsiderClient, "outsider", "Password123", "Outsider");
|
||||
await LoginAsync(outsiderClient, "outsider", "Password123");
|
||||
|
||||
@@ -32,7 +32,7 @@ public sealed class HostingCoverageTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SqliteSchemaUpgrader_MigratesLegacySkillsSchema()
|
||||
public void SqliteSchemaUpgrader_MigratesLegacySchema()
|
||||
{
|
||||
var dbPath = Path.Combine(Path.GetTempPath(), $"rpgroller-legacy-upgrade-{Guid.NewGuid():N}.db");
|
||||
var connectionString = $"Data Source={dbPath}";
|
||||
@@ -119,6 +119,17 @@ public sealed class HostingCoverageTests
|
||||
Assert.Contains("WildDice", columns);
|
||||
Assert.Contains("AllowFumble", columns);
|
||||
|
||||
using var rollTableInfoCommand = verifyConnection.CreateCommand();
|
||||
rollTableInfoCommand.CommandText = "PRAGMA table_info('RollLogEntries');";
|
||||
using var rollTableInfoReader = rollTableInfoCommand.ExecuteReader();
|
||||
var rollColumns = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
while (rollTableInfoReader.Read())
|
||||
{
|
||||
rollColumns.Add(rollTableInfoReader.GetString(1));
|
||||
}
|
||||
|
||||
Assert.Contains("Dice", rollColumns);
|
||||
|
||||
using var historyCommand = verifyConnection.CreateCommand();
|
||||
historyCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226084000_InitialSchema';";
|
||||
var historyCount = Convert.ToInt32(historyCommand.ExecuteScalar());
|
||||
@@ -128,5 +139,10 @@ public sealed class HostingCoverageTests
|
||||
modelSyncHistoryCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226090000_ModelSync';";
|
||||
var modelSyncHistoryCount = Convert.ToInt32(modelSyncHistoryCommand.ExecuteScalar());
|
||||
Assert.Equal(1, modelSyncHistoryCount);
|
||||
|
||||
using var rollDiceHistoryCommand = verifyConnection.CreateCommand();
|
||||
rollDiceHistoryCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226100000_AddRollLogDice';";
|
||||
var rollDiceHistoryCount = Convert.ToInt32(rollDiceHistoryCommand.ExecuteScalar());
|
||||
Assert.Equal(1, rollDiceHistoryCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ public sealed class ServiceSkillRollTests
|
||||
Assert.Equal(2, ServiceTestSupport.GetValue(ownerLog).Count);
|
||||
Assert.Equal(2, ServiceTestSupport.GetValue(gmLog).Count);
|
||||
Assert.False(outsiderLog.Succeeded);
|
||||
Assert.All(ServiceTestSupport.GetValue(ownerLog), entry => Assert.NotEmpty(entry.Dice));
|
||||
Assert.All(ServiceTestSupport.GetValue(gmLog), entry => Assert.NotEmpty(entry.Dice));
|
||||
|
||||
var version = service.GetCampaignVersion(ownerSession, campaign.Id);
|
||||
var missingVersion = service.GetCampaignVersion(ownerSession, Guid.NewGuid());
|
||||
|
||||
Reference in New Issue
Block a user