Skip to content

Commit 856492e

Browse files
authored
Merge pull request #172 from mariohmol/fix/menu-bar-defaults-issue-133
fix: initialize mainMenuBar, navigationBar, statusBar to true by default
2 parents 701d0f9 + d3c6f33 commit 856492e

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)