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);
    }
}
