fix(viewer): fresh signups start at tutorial_state=0, not 100
Previously RegisterAnonymousViewer auto-completed the tutorial, which prevented the client from ever entering the tutorial flow. SeedViewerAsync gains a tutorialState parameter (default 100) so existing tests keep their pre-completed-tutorial assumption.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using SVSim.Database;
|
||||
using SVSim.Database.Repositories.Viewer;
|
||||
using SVSim.UnitTests.Infrastructure;
|
||||
|
||||
namespace SVSim.UnitTests.Repositories;
|
||||
|
||||
public class ViewerRepositoryTutorialDefaultTests
|
||||
{
|
||||
[Test]
|
||||
public async Task RegisterAnonymousViewer_starts_at_tutorial_step_0()
|
||||
{
|
||||
using var factory = new SVSimTestFactory();
|
||||
using var scope = factory.Services.CreateScope();
|
||||
var repo = scope.ServiceProvider.GetRequiredService<IViewerRepository>();
|
||||
|
||||
var viewer = await repo.RegisterAnonymousViewer(Guid.NewGuid());
|
||||
|
||||
Assert.That(viewer.MissionData.TutorialState, Is.EqualTo(0),
|
||||
"Fresh signups must start at PRE_TUTORIAL_STEP=0 so the client triggers the tutorial flow. " +
|
||||
"Tests that want a pre-completed tutorial should use SeedViewerAsync (which defaults to 100).");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user