/
vertial.spec.ts
40 lines (36 loc) · 1.37 KB
/
vertial.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/// <reference path="../../../references.ts"/>
describe('VerticalLayout', () => {
// load all necessary modules and templates
beforeEach(module('jsonforms.form'));
beforeEach(module('jsonforms.renderers.layouts.vertical'));
beforeEach(module('jsonforms.renderers.controls.string'));
beforeEach(module('components/form/form.html'));
beforeEach(module('components/renderers/layouts/layout.html'));
beforeEach(module('components/renderers/controls/control.html'));
it("should not support labels", inject(($rootScope, $compile) => {
let scope = $rootScope.$new();
scope.schema = {
"properties": {
"foo": { "type": "string" }
}
};
scope.uiSchema = {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": {
"$ref": "#/properties/foo"
}
}
]
};
scope.data = { "name": "John Doe "};
let el = $compile('<jsonforms schema="schema" ui-schema="uiSchema" data="data"/>')(scope);
scope.$digest();
let div = el.find('div');
console.log(div.children());
let layout = angular.element(div.children()[0]);
expect(layout.hasClass('jsf-vertical-layout')).toBeTruthy();
}));
});