-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,48 @@ | ||
import "angular" | ||
import "angular-mocks" | ||
|
||
import 'angular'; | ||
import 'angular-mocks'; | ||
import '../../index'; | ||
import IRootScopeService = angular.IRootScopeService; | ||
import ICompileService = angular.ICompileService; | ||
|
||
describe("Renderer service", () => { | ||
describe('Renderer service', () => { | ||
|
||
|
||
beforeEach(angular.mock.module('jsonforms.form')); | ||
|
||
xit("should support remote references", | ||
it('should support remote references', | ||
angular.mock.inject(($rootScope: IRootScopeService, $compile: ICompileService) => { | ||
|
||
let scope = $rootScope.$new(); | ||
// empty schema | ||
scope['schema'] = {}; | ||
scope['uiSchema'] = { | ||
"type": "Control", | ||
"scope": { | ||
"$ref": "http://json-schema.org/geo#/latitude" | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': 'http://json-schema.org/geo#/latitude' | ||
} | ||
}; | ||
scope['data'] = { "latitude": 42 }; | ||
scope['data'] = { 'latitude': 42 }; | ||
let el = $compile('<jsonforms schema="schema" ui-schema="uiSchema" data="data"/>')(scope); | ||
scope.$digest(); | ||
let input = angular.element(el[0].getElementsByClassName('jsf-control-number')); | ||
expect(input).toBeDefined(); | ||
})); | ||
}); | ||
|
||
it('should add comment to dom on unknown renderer', | ||
angular.mock.inject(($rootScope: IRootScopeService, $compile: ICompileService) => { | ||
|
||
let scope = $rootScope.$new(); | ||
// empty schema | ||
scope['schema'] = {}; | ||
scope['uiSchema'] = { | ||
'type': 'UNKNOWN_CONTROL', | ||
'scope': { | ||
'$ref': 'http://json-schema.org/geo#/latitude' | ||
} | ||
}; | ||
scope['data'] = { 'latitude': 42 }; | ||
let el = $compile('<jsonforms schema="schema" ui-schema="uiSchema" data="data"/>')(scope); | ||
scope.$digest(); | ||
expect(el.html()).toContain('<!-- No Renderer for UNKNOWN_CONTROL. -->'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters