Skip to content

Commit d3c6f33

Browse files
mariohmolclaude
andcommitted
fix: initialize mainMenuBar, navigationBar, statusBar to true by default (closes #133)
JsonEditorOptions declared these as boolean but never initialized them, so they were undefined and newer versions of the underlying jsoneditor library stopped treating undefined as the documented true default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fd6abc8 commit d3c6f33

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

projects/ang-jsoneditor/src/lib/jsoneditor.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
22

33
import { JsonEditor } from './jsoneditor';
4+
import { JsonEditorOptions } from './jsoneditoroptions';
45

56
describe('JsoneditorComponent', () => {
67
let component: JsonEditor;
@@ -22,4 +23,21 @@ describe('JsoneditorComponent', () => {
2223
it('should be created', () => {
2324
expect(component).toBeTruthy();
2425
});
26+
27+
describe('JsonEditorOptions defaults', () => {
28+
it('should default mainMenuBar to true', () => {
29+
const options = new JsonEditorOptions();
30+
expect(options.mainMenuBar).toBe(true);
31+
});
32+
33+
it('should default navigationBar to true', () => {
34+
const options = new JsonEditorOptions();
35+
expect(options.navigationBar).toBe(true);
36+
});
37+
38+
it('should default statusBar to true', () => {
39+
const options = new JsonEditorOptions();
40+
expect(options.statusBar).toBe(true);
41+
});
42+
});
2543
});

projects/ang-jsoneditor/src/lib/jsoneditoroptions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,8 @@ export class JsonEditorOptions {
160160
this.mode = 'tree';
161161
this.search = true;
162162
this.indentation = 2;
163+
this.mainMenuBar = true;
164+
this.navigationBar = true;
165+
this.statusBar = true;
163166
}
164167
}

0 commit comments

Comments
 (0)