@sankhyalabs/core 5.20.0-dev.38 → 5.20.0-dev.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,134 +1,144 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
3
+ <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
4
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="71"/>
5
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
6
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="0"/>
7
+ <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="1"/>
8
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;append&quot; method" duration="89"/>
9
+ <testCase name="StringUtils it should return undefined as &quot;expression&quot; and &quot;[]&quot; as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
10
+ <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="0"/>
11
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
12
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
13
+ <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="18"/>
14
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
15
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
16
+ <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
17
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
18
+ </file>
19
+ <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
20
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="74"/>
21
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="0"/>
22
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="1"/>
23
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
24
+ <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="1"/>
25
+ <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
26
+ <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
27
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
28
+ <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
29
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="1"/>
30
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
31
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
32
+ <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="0"/>
33
+ </file>
3
34
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
4
- <testCase name="Mask Formatter mask:CPF complete valid" duration="93"/>
35
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="94"/>
5
36
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
6
37
  <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
7
38
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
8
- <testCase name="Mask Formatter mask:CPF too long valid" duration="2"/>
9
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="295"/>
39
+ <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
40
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="207"/>
10
41
  <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
11
- <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="0"/>
12
- <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
13
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
14
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
42
+ <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
43
+ <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
44
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
45
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="3"/>
15
46
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
16
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
47
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
17
48
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
18
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
19
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
20
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="9"/>
49
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
50
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
51
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
52
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
53
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
54
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
21
55
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
22
56
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
23
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
24
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="73"/>
25
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
26
- </file>
27
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
28
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="71"/>
29
- <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
30
- <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
31
- <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="6"/>
32
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;append&quot; method" duration="1"/>
33
- <testCase name="StringUtils it should return undefined as &quot;expression&quot; and &quot;[]&quot; as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
34
- <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="94"/>
35
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
36
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="2"/>
37
- <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="3"/>
38
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="0"/>
39
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
40
- <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
41
- <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="1"/>
42
- </file>
43
- <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
44
- <testCase name="HttpProvider Metodo GET" duration="10"/>
45
57
  </file>
46
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
47
- <testCase name="HttpProvider Metodo POST" duration="1"/>
58
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
59
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="8"/>
60
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
61
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="277"/>
62
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="15"/>
63
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="105"/>
64
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="7"/>
65
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
66
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="14"/>
67
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
48
68
  </file>
49
69
  <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
50
- <testCase name="StringUtils valor vazio" duration="2"/>
70
+ <testCase name="StringUtils valor vazio" duration="1"/>
51
71
  <testCase name="StringUtils valor em branco" duration="1"/>
52
72
  <testCase name="StringUtils valor null" duration="0"/>
53
- <testCase name="StringUtils valor undefined" duration="0"/>
73
+ <testCase name="StringUtils valor undefined" duration="1"/>
54
74
  <testCase name="StringUtils valor 0" duration="0"/>
55
75
  <testCase name="StringUtils com valor" duration="0"/>
56
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="1"/>
57
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="3"/>
58
- <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
76
+ <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
77
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
78
+ <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
59
79
  </file>
60
80
  <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
61
- <testCase name="StringUtils stringToNumber" duration="11"/>
62
- <testCase name="StringUtils format" duration="206"/>
63
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
64
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
65
- <testCase name="StringUtils format round number" duration="2"/>
81
+ <testCase name="StringUtils stringToNumber" duration="16"/>
82
+ <testCase name="StringUtils format" duration="278"/>
83
+ <testCase name="StringUtils format without formatnumber parameter" duration="0"/>
84
+ <testCase name="StringUtils format without formatnumber parameter" duration="2"/>
85
+ <testCase name="StringUtils format round number" duration="1"/>
86
+ </file>
87
+ <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
88
+ <testCase name="HttpProvider Metodo GET" duration="1"/>
89
+ </file>
90
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
91
+ <testCase name="HttpProvider Metodo POST" duration="1"/>
66
92
  </file>
67
93
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
68
94
  <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="1"/>
69
95
  <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the setters methods" duration="1"/>
70
- <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="0"/>
71
- </file>
72
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
73
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="84"/>
74
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
75
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="292"/>
76
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="26"/>
77
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="82"/>
78
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="9"/>
79
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="6"/>
80
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="91"/>
81
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
82
- </file>
83
- <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
84
- <testCase name="ObjectUtils should get an object value based on its path" duration="2"/>
85
- <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
86
- <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="2"/>
96
+ <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
87
97
  </file>
88
98
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
89
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="3"/>
90
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="2"/>
91
- <testCase name="TimeFormatter Case: validateTime" duration="10"/>
99
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
100
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
101
+ <testCase name="TimeFormatter Case: validateTime" duration="1"/>
92
102
  </file>
93
103
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
94
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="72"/>
95
- <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
96
- <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
97
- <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
104
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="3"/>
105
+ <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
106
+ <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="0"/>
107
+ <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
98
108
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
99
109
  <testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="1"/>
100
110
  </file>
101
111
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
102
- <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="11"/>
112
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="18"/>
103
113
  <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
104
114
  <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
105
115
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
106
116
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
107
- <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="66"/>
108
- <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="2"/>
117
+ <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
118
+ <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
109
119
  <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
110
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
120
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
111
121
  <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
112
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
122
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="62"/>
113
123
  <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
114
- <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="17"/>
115
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="72"/>
124
+ <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
125
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="2"/>
116
126
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
117
127
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
118
128
  <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
119
- <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="5"/>
120
- <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
121
- <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
129
+ <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
130
+ <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="11"/>
131
+ <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
122
132
  <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
123
133
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
124
134
  </file>
125
135
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
126
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="29"/>
136
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="27"/>
127
137
  <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
128
- <testCase name="calcMarginSize should threat values defined as zero" duration="4"/>
138
+ <testCase name="calcMarginSize should threat values defined as zero" duration="3"/>
129
139
  </file>
130
140
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
131
- <testCase name="getFormattedValue should return empty string when value is null" duration="5"/>
141
+ <testCase name="getFormattedValue should return empty string when value is null" duration="4"/>
132
142
  <testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
133
143
  <testCase name="getFormattedValue should return empty string when value is an empty array" duration="1"/>
134
144
  <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
@@ -137,20 +147,20 @@
137
147
  <testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
138
148
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="1"/>
139
149
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
140
- <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="1"/>
150
+ <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
141
151
  <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
142
- <testCase name="getFormattedValue should format numbers correctly" duration="11"/>
143
- <testCase name="getFormattedValue should format dates correctly" duration="23"/>
152
+ <testCase name="getFormattedValue should format numbers correctly" duration="10"/>
153
+ <testCase name="getFormattedValue should format dates correctly" duration="4"/>
144
154
  <testCase name="getFormattedValue should format times correctly" duration="1"/>
145
- <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
155
+ <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
146
156
  <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
147
157
  <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
148
158
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
149
159
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
150
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="1"/>
160
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
151
161
  <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
152
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
153
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
154
- <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
162
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="1"/>
163
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
164
+ <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
155
165
  </file>
156
166
  </unitTest>
@@ -970,6 +970,10 @@ export default class DataUnit {
970
970
 
971
971
  const typedValue = this.validateAndTypeValue(fieldName, newValue);
972
972
  const currentValue = this.getFieldValue(fieldName);
973
+
974
+ if(ObjectUtils.hasEquivalentProps(currentValue, typedValue)){
975
+ return Promise.resolve(false);
976
+ }
973
977
 
974
978
  if(newValue instanceof Promise){
975
979
  const promise:Promise<boolean> = new Promise(accept => {
@@ -85,6 +85,31 @@ export default class ObjectUtils{
85
85
  return ObjectUtils.objectToString(obj1) === ObjectUtils.objectToString(obj2);
86
86
  }
87
87
 
88
+ /**
89
+ * Compara se o valor de dois items são equivalentes.
90
+ * Comparando tanto o valor do item em si, quanto sua propriedade "value"
91
+ *
92
+ * @param obj1 - Objeto a ser comparado.
93
+ * @param obj2 - Objeto a ser comparado.
94
+ * @param propToCompare - propriedade que deve ser comparada.
95
+ * @returns - Se o objeto 1 é equivalente ao objeto 2.
96
+ *
97
+ * * @example
98
+ * hasEquivalentProps('123', {value: '123', label: teste}, 'value') | Retorna: true
99
+ * @example
100
+ * hasEquivalentProps('xpto', {value: '123', label: teste}, 'propName') | Retorna: false
101
+ */
102
+ public static hasEquivalentProps(obj1: any, obj2: any, propToCompare:string = "value"): boolean{
103
+ return this.getComparableProp(obj1, propToCompare) == this.getComparableProp(obj2, propToCompare);
104
+ }
105
+
106
+ private static getComparableProp(value: any, propToCompare:string = "value"): boolean{
107
+ if (typeof value === 'object' && value !== null && propToCompare in value) {
108
+ return value[propToCompare];
109
+ }
110
+ return value;
111
+ }
112
+
88
113
  /**
89
114
  * Verifica se o objeto está vazio (sem atributos).
90
115
  *
@@ -1,6 +1,70 @@
1
1
  import ObjectUtils from '../ObjectUtils'
2
2
 
3
3
  describe("ObjectUtils", () => {
4
+ describe('hasEquivalentValues', () => {
5
+ it('should return true if both objects have the same property value', () => {
6
+ const obj1 = { value: 10 };
7
+ const obj2 = { value: 10 };
8
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(true);
9
+ });
10
+
11
+ it('should return false if both objects have different property values', () => {
12
+ const obj1 = { value: 10 };
13
+ const obj2 = { value: 20 };
14
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(false);
15
+ });
16
+
17
+ it('should return true if both objects are equivalent with custom property to compare', () => {
18
+ const obj1 = { customProp: 'hello' };
19
+ const obj2 = { customProp: 'hello' };
20
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2, 'customProp')).toBe(true);
21
+ });
22
+
23
+ it('should return false if both objects are not equivalent with custom property to compare', () => {
24
+ const obj1 = { customProp: 'hello' };
25
+ const obj2 = { customProp: 'world' };
26
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2, 'customProp')).toBe(false);
27
+ });
28
+
29
+ it('should return false if one object does not have the property', () => {
30
+ const obj1 = { value: 10 };
31
+ const obj2 = { anotherProp: 10 };
32
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(false);
33
+ });
34
+
35
+ it('should return true if comparing primitive values directly', () => {
36
+ const obj1 = 5;
37
+ const obj2 = 5;
38
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(true);
39
+ });
40
+
41
+ it('should return false if comparing different primitive values', () => {
42
+ const obj1 = 5;
43
+ const obj2 = 10;
44
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(false);
45
+ });
46
+
47
+ it('should return true when comparing object with a null value', () => {
48
+ const obj1 = null;
49
+ const obj2 = null;
50
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(true);
51
+ });
52
+
53
+ it('should return false when comparing object with null and non-null value', () => {
54
+ const obj1 = null;
55
+ const obj2 = { value: 5 };
56
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(false);
57
+ });
58
+
59
+ it('should return true when comparing non-object values that are equal', () => {
60
+ const obj1 = 'same';
61
+ const obj2 = 'same';
62
+ expect(ObjectUtils.hasEquivalentProps(obj1, obj2)).toBe(true);
63
+ });
64
+
65
+ });
66
+
67
+
4
68
  it("should get an object value based on its path", async () => {
5
69
  const obj = {
6
70
  food: {