# Clone the repository
git clone https://github.com/AaronSadlerUK/Umbraco.Community.UmbNav.git
cd Umbraco.Community.UmbNav
# Restore .NET packages
dotnet restore
# Install npm packages
cd Umbraco.Community.UmbNav
npm install
# Build frontend
npm run build
# Build backend
cd ..
dotnet build
# Start the test site
dotnet run --project TestSite.V17
cd Umbraco.Community.UmbNav
# Watch mode for development
npm run watch
# Production build
npm run build
# Type checking
npm run typecheck
# C# unit tests
dotnet test
# Playwright E2E tests
cd Umbraco.Community.UmbNav
npx playwright test
# Headed mode (see browser)
npx playwright test --headed
# Debug mode
npx playwright test --debug
/// <summary>
/// Builds a processed menu from raw UmbNav items.
/// </summary>
/// <param name="items">The raw menu items.</param>
/// <param name="options">Build options.</param>
/// <returns>Processed menu items ready for rendering.</returns>
public IEnumerable<UmbNavItem> BuildMenu(
IEnumerable<UmbNavItem>? items,
UmbNavBuildOptions? options = null)
{
// Implementation
}
public class MyServiceTests
{
[Fact]
public void MyMethod_WithValidInput_ReturnsExpectedResult()
{
// Arrange
var service = new MyService();
// Act
var result = service.MyMethod("input");
// Assert
Assert.Equal("expected", result);
}
}
import { expect } from '@playwright/test';
import { test } from "@umbraco/playwright-testhelpers";
test.describe("My Feature", () => {
test('should work correctly', async ({ umbracoUi }) => {
// Test implementation
});
});