fix: show sidenav shell when layout is sidenav even with no sections

Co-authored-by: eromano <1030050+eromano@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-08-28 14:53:38 +00:00
committed by GitHub
co-authored by eromano
parent 7aaaa5dd82
commit 3f8fb54976
2 changed files with 8 additions and 2 deletions
@@ -1119,6 +1119,12 @@ describe('Form Renderer Component', () => {
expect(form.hasSideNav()).toBeFalse(); expect(form.hasSideNav()).toBeFalse();
}); });
it('should report hasSideNav as true when layout is sidenav even with no sections', () => {
const form = new FormModel({ layout: 'sidenav', tabs: [], fields: [] });
formRendererComponent.formDefinition = form;
expect(form.hasSideNav()).toBeTrue();
});
it('should default the active section to the first visible leaf node', () => { it('should default the active section to the first visible leaf node', () => {
formRendererComponent.formDefinition = buildSideNavForm(); formRendererComponent.formDefinition = buildSideNavForm();
expect(formRendererComponent.activeSideNavSectionId()).toBe('section-1'); expect(formRendererComponent.activeSideNavSectionId()).toBe('section-1');
@@ -354,10 +354,10 @@ export class FormModel implements ProcessFormModel {
* Indicates whether the form should be rendered using the hierarchical side navigation * Indicates whether the form should be rendered using the hierarchical side navigation
* layout instead of the classic tabs layout. * layout instead of the classic tabs layout.
* *
* @returns true when the form has tabs and its layout is set to `sidenav` * @returns true when the form layout is set to `sidenav`
*/ */
hasSideNav(): boolean { hasSideNav(): boolean {
return this.layout === 'sidenav' && this.hasTabs(); return this.layout === 'sidenav';
} }
/** /**