-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCustomFieldsSpec.js
executable file
·142 lines (142 loc) · 3.93 KB
/
CustomFieldsSpec.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// describe('DIRECTIVE: GumgaCustomFields',function(){
// let scope;
// let isolatedScope;
// let template;
// let rootScope;
// beforeEach(module('gumga.directives.customfields'));
// beforeEach(inject(($rootScope,$compile) => {
// rootScope = $rootScope;
// scope = $rootScope.$new();
//
// scope.custom = {
// "id":null,
// "oi":null,
// "gumgaCustomFields":{
// "opcoes":{
// "id":null,
// "oi":null,
// "field":{
// "id":1,
// "oi":null,
// "clazz":"br.com.empresa.piloto.domain.model.Marca",
// "name":"opcoes",
// "description":"Custom Select Field for test",
// "active":true,
// "type":"SELECTION",
// "validationDescription":"Not empty"
// ,"validationScript":"true",
// "defaultValueScript": "",
// "options": {
// "pageSize": 10,
// "count": 26,
// "start": 0,
// "values": [
// {
// "id": 1,
// "oi": null,
// "name": "GUMGA",
// "subOrganizations": null,
// "mainOrganization":
// {
// "value": true
// },
// "hierarchyCode": "1.",
// "logo": null
// },
// {
// "id": 2,
// "oi": null,
// "name": "FrontEnd",
// "subOrganizations": null,
// "mainOrganization":
// {
// "value": false
// },
// "hierarchyCode": "1.2.",
// "logo": null
// }
// ]
// },
// "visualizationOrder":2,
// "fieldGroup":"MAIN_FIELDS",
// "translateKey":"marca.tamanho",
// "optionValueField": "id",
// "optionLabelField": "name",
// "optionsCollection": "values"
// },
// "gumgaModelId":null,
// "textValue":null,
// "numberValue":6.5,
// "dateValue":null,
// "logicValue":null
// },
// "tamanho":{
// "id":null,
// "oi":null,
// "field":{
// "id":2,
// "oi":null,
// "clazz":"br.com.empresa.piloto.domain.model.Marca",
// "name":"tamanho",
// "description":"Custom Number Field for test","active":true,
// "type":"NUMBER",
// "validationDescription":"Not empty"
// ,"validationScript":"true",
// "defaultValueScript":"13 / 2",
// "options":"",
// "visualizationOrder":2,
// "fieldGroup":"MAIN_FIELDS",
// "translateKey":"marca.tamanho"
// },
// "gumgaModelId":null,
// "textValue":null,
// "numberValue":6.5,
// "dateValue":null,
// "logicValue":null
// },
// "inicio":{
// "id":null,
// "oi":null,
// "field":{
// "id":4,
// "oi":null,
// "clazz":"br.com.empresa.piloto.domain.model.Marca",
// "name":"inicio",
// "description":"Custom Date Field for test","active":true,
// "type":"DATE",
// "validationDescription":"Not empty",
// "validationScript":"true",
// "defaultValueScript":"new Date()",
// "options":"",
// "visualizationOrder":0.0,
// "fieldGroup":"MAIN_FIELDS",
// "translateKey":"marca.inicio"
// },
// "gumgaModelId":null,
// "textValue":null,
// "numberValue":null,
// "dateValue":"2015-11-03T11:26:13Z",
// "logicValue":null
// },
// },
// "version":null,
// "nome":null,
// "location":null
// };
//
// let element = angular.element('<gumga-custom-fields fields="custom"></gumga-custom-fields>');
// $compile(element)(scope);
// isolatedScope = element.isolateScope();
// }));
//
//
// it('Should check the type SELECTION', () => {
// // expect(isolatedScope.ctrl.fields.gumgaCustomFields.opcoes.field.options.values.length).toEqual(2);
// });
//
// it('Should check the type NUMBER', () => {
// });
//
// it('Should check the type DATE', () => {
// });
// })