Six wizard step components (Welcome/Flavour/Account/Prefs/Apply/Done), Routes.razor wizard host with Next/Back navigation and IFlavourLoader wiring, bUnit FlavourStepTests (TDD red→green), AccountStep field validation (username/password/admin-password required; BitLocker PIN numeric ≥6 digits). Test project upgraded to Razor SDK / net9.0-windows10.0.19041.0 + UseMaui=true to reference the MAUI app assembly. Non-Windows platform folders removed; demo pages removed. All 14 tests pass (13 existing + 1 new bUnit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
926 B
C#
24 lines
926 B
C#
using Bunit;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using SilverOS.Welcome.App.Components.Steps;
|
|
using SilverOS.Welcome.App.Components;
|
|
using SilverOS.Welcome.Core.Flavours;
|
|
using Xunit;
|
|
|
|
public class FlavourStepTests : TestContext
|
|
{
|
|
[Fact]
|
|
public void Renders_one_card_per_flavour_and_preselects_default()
|
|
{
|
|
var flavours = new[]
|
|
{
|
|
new FlavourManifest { Id="daily-driver", Label="Daily-Driver", IsDefault=true, Hardening=new(){Modules=new[]{"00"}} },
|
|
new FlavourManifest { Id="privacy-max", Label="Privacy-Max", Hardening=new(){Modules=new[]{"00"}} },
|
|
};
|
|
Services.AddSingleton(new WizardState());
|
|
var cut = RenderComponent<FlavourStep>(p => p.Add(s => s.Flavours, flavours));
|
|
Assert.Equal(2, cut.FindAll(".flavour-card").Count);
|
|
Assert.Contains("selected", cut.Find(".flavour-card[data-id=daily-driver]").ClassList);
|
|
}
|
|
}
|