using Bunit;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using ScadaLink.CentralUI.Components.Shared;
namespace ScadaLink.CentralUI.Tests;
///
/// bUnit tests for the TreeView component covering core rendering,
/// expand/collapse behavior, ARIA attributes, and indentation.
///
public class TreeViewTests : BunitContext
{
private record TestNode(string Key, string Label, List Children);
private static List SimpleRoots() => new()
{
new("a", "Alpha", new()
{
new("a1", "Alpha-1", new()),
new("a2", "Alpha-2", new()
{
new("a2x", "Alpha-2-X", new())
})
}),
new("b", "Beta", new()),
};
private IRenderedComponent> RenderTreeView(
List? items = null,
RenderFragment? emptyContent = null,
int indentPx = 24,
Func? initiallyExpanded = null,
bool selectable = false,
object? selectedKey = null,
Action