review fixes: complete success path, pool capacity navigation, time parser tests
PR Checks / test-and-build (pull_request) Successful in 24m27s
PR Checks / test-and-build (pull_request) Successful in 24m27s
- DiscordWizardSubmitter.SubmitAsync: confirm success, delete draft, clear context. - GameCreationWizard: pool free-text duration now advances to Capacity. - PreviousStep(Capacity) returns PoolSystemDuration for pools. - Remove unused optional IPlatformMessenger/NpgsqlDataSource from submitter. - Add DiscordTimeParserTests preserving ParseTimeInput coverage.
This commit is contained in:
+42
@@ -93,6 +93,48 @@ public sealed class GameCreationWizardStepTransitionsTests
|
||||
Assert.Equal(10, maxPlayers.GetInt32());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task PoolSystemDuration_FreeTextDuration_AdvancesToCapacity()
|
||||
{
|
||||
var wizard = BuildWizard(out var drafts, out _);
|
||||
var payload = new WizardPayload
|
||||
{
|
||||
Type = WizardCreationType.Pool,
|
||||
Title = "Pool",
|
||||
System = "Dnd5e",
|
||||
};
|
||||
var draft = NewDraft(WizardStepNames.PoolSystemDuration, payload);
|
||||
drafts.Seed(draft);
|
||||
|
||||
await wizard.HandleInteractionAsync(TextInteraction("4", ownerId: draft.OwnerId), draft, CancellationToken.None);
|
||||
|
||||
Assert.Equal(WizardStepNames.Capacity, draft.Step);
|
||||
using var doc = JsonDocument.Parse(draft.PayloadJson);
|
||||
var root = doc.RootElement;
|
||||
Assert.True(root.TryGetProperty("durationMinutes", out var dur));
|
||||
Assert.Equal(240, dur.GetInt32());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Back_FromPoolCapacity_GoesToPoolSystemDuration()
|
||||
{
|
||||
var wizard = BuildWizard(out var drafts, out _);
|
||||
var payload = new WizardPayload
|
||||
{
|
||||
Type = WizardCreationType.Pool,
|
||||
Title = "Pool",
|
||||
System = "Dnd5e",
|
||||
DurationMinutes = 240,
|
||||
};
|
||||
var draft = NewDraft(WizardStepNames.Capacity, payload);
|
||||
drafts.Seed(draft);
|
||||
|
||||
var data = WizardCallbackData.Back();
|
||||
await wizard.HandleInteractionAsync(CallbackInteraction(data, ownerId: draft.OwnerId), draft, CancellationToken.None);
|
||||
|
||||
Assert.Equal(WizardStepNames.PoolSystemDuration, draft.Step);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("waitlist:on")]
|
||||
[InlineData("waitlist:off")]
|
||||
|
||||
Reference in New Issue
Block a user