using NexusShell.Services.Policy;
using NexusShell.ViewModels;
using Xunit;

namespace NexusShell.Tests;

public sealed class DockPolicyMappingTests
{
    [Theory]
    [InlineData("Home", "launcher")]
    [InlineData("Nexus Home", "launcher")]
    [InlineData("App Hub", "launcher")]
    [InlineData("Files", "files")]
    [InlineData("Browser", "browser")]
    [InlineData("Console", "console")]
    [InlineData("Calculator", "calculator")]
    [InlineData("Diagnostics", "settings")]
    [InlineData("Updates", "settings")]
    [InlineData("Store", "store")]
    public void Dock_labels_map_to_policy_app_keys(string label, string expected)
    {
        Assert.Equal(expected, NexusPolicyAppKeys.FromDockLabel(label));
    }

    [Fact]
    public void Primary_dock_catalog_is_limited_to_seven_os_shell_items()
    {
        var labels = DesktopViewModel.PrimaryDockCatalog.Select(item => item.Label).ToArray();

        Assert.True(labels.Length <= 7);
        Assert.Equal(
            ["Home", "Search", "App Hub", "Files", "Browser", "Settings", "Diagnostics"],
            labels);
    }
}
