@sankhyalabs/core 5.20.0-dev.64 → 5.20.0-dev.66

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,175 +1,175 @@
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="7"/>
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="2"/>
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="1"/>
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="3"/>
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="2"/>
17
- <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="1"/>
3
+ <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
4
+ <testCase name="HttpProvider Metodo GET" duration="71"/>
5
+ </file>
6
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
7
+ <testCase name="HttpProvider Metodo POST" duration="79"/>
18
8
  </file>
19
9
  <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="6"/>
10
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="5"/>
21
11
  <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"/>
12
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
13
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="0"/>
24
14
  <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
25
- <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
26
- <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="1"/>
27
- <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="1"/>
28
- <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="0"/>
15
+ <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
16
+ <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
17
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
18
+ <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
29
19
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
30
- <testCase name="ObjectUtils should get an object value based on its path" duration="106"/>
31
20
  <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="1"/>
21
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
22
+ <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="88"/>
33
23
  </file>
34
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
35
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="11"/>
36
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
37
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="183"/>
38
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="24"/>
39
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="73"/>
40
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="101"/>
41
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="33"/>
42
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="81"/>
43
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
24
+ <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
25
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="103"/>
26
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
27
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
28
+ <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="2"/>
29
+ <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"/>
30
+ <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"/>
31
+ <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="1"/>
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;OR&quot; method" duration="1"/>
33
+ <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="24"/>
34
+ <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="1"/>
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;AND&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;AND&quot; method" duration="1"/>
37
+ <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"/>
38
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
44
39
  </file>
45
40
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
46
- <testCase name="Mask Formatter mask:CPF complete valid" duration="19"/>
41
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="96"/>
47
42
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
48
43
  <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
49
- <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="4"/>
50
- <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
51
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="182"/>
44
+ <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
45
+ <testCase name="Mask Formatter mask:CPF too long valid" duration="20"/>
46
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="279"/>
52
47
  <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
53
48
  <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
54
49
  <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
55
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="14"/>
56
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="2"/>
57
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
58
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
50
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="66"/>
51
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
52
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
53
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="13"/>
59
54
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
60
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="10"/>
61
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
55
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
56
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
62
57
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
63
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="8"/>
58
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="2"/>
59
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="4"/>
60
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
61
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
64
62
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
65
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
66
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
67
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="102"/>
68
- </file>
69
- <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
70
- <testCase name="StringUtils stringToNumber" duration="85"/>
71
- <testCase name="StringUtils format" duration="89"/>
72
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
73
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
74
- <testCase name="StringUtils format round number" duration="1"/>
75
- </file>
76
- <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
77
- <testCase name="HttpProvider Metodo GET" duration="1"/>
78
- </file>
79
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
80
- <testCase name="HttpProvider Metodo POST" duration="1"/>
81
- </file>
82
- <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
83
- <testCase name="StringUtils valor vazio" duration="9"/>
84
- <testCase name="StringUtils valor em branco" duration="0"/>
85
- <testCase name="StringUtils valor null" duration="1"/>
86
- <testCase name="StringUtils valor undefined" duration="0"/>
87
- <testCase name="StringUtils valor 0" duration="2"/>
88
- <testCase name="StringUtils com valor" duration="1"/>
89
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="1"/>
90
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
91
- <testCase name="StringUtils should return the original value when called with undefined" duration="2"/>
92
63
  </file>
93
64
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
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="2"/>
65
+ <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="11"/>
95
66
  <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"/>
96
67
  <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
97
68
  </file>
98
69
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
99
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
100
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
101
- <testCase name="TimeFormatter Case: validateTime" duration="6"/>
70
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="3"/>
71
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
72
+ <testCase name="TimeFormatter Case: validateTime" duration="1"/>
102
73
  </file>
103
74
  <file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
104
- <testCase name="RecordsSlice should return newlines at the end" duration="2"/>
75
+ <testCase name="RecordsSlice should return newlines at the end" duration="80"/>
105
76
  </file>
106
- <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
107
- <testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
108
- <testCase name="DataUnit should set waitingToReload to true" duration="0"/>
109
- <testCase name="DataUnit should set waitingToReload to false" duration="1"/>
110
- <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
77
+ <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
78
+ <testCase name="StringUtils valor vazio" duration="7"/>
79
+ <testCase name="StringUtils valor em branco" duration="1"/>
80
+ <testCase name="StringUtils valor null" duration="0"/>
81
+ <testCase name="StringUtils valor undefined" duration="1"/>
82
+ <testCase name="StringUtils valor 0" duration="1"/>
83
+ <testCase name="StringUtils com valor" duration="9"/>
84
+ <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
85
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="6"/>
86
+ <testCase name="StringUtils should return the original value when called with undefined" duration="71"/>
87
+ </file>
88
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
89
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="28"/>
90
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
91
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="293"/>
92
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="12"/>
93
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="19"/>
94
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="21"/>
95
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="8"/>
96
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="193"/>
97
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="2"/>
98
+ </file>
99
+ <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
100
+ <testCase name="StringUtils stringToNumber" duration="100"/>
101
+ <testCase name="StringUtils format" duration="510"/>
102
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
103
+ <testCase name="StringUtils format without formatnumber parameter" duration="105"/>
104
+ <testCase name="StringUtils format round number" duration="2"/>
111
105
  </file>
112
106
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
113
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
107
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="56"/>
114
108
  <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
115
109
  <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
116
110
  <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
117
111
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
118
112
  <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"/>
119
113
  </file>
114
+ <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
115
+ <testCase name="DataUnit should return false when not waiting to reload" duration="4"/>
116
+ <testCase name="DataUnit should set waitingToReload to true" duration="1"/>
117
+ <testCase name="DataUnit should set waitingToReload to false" duration="1"/>
118
+ <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="10"/>
119
+ </file>
120
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
121
- <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="81"/>
121
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="20"/>
122
122
  <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
123
123
  <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
124
124
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
125
125
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
126
126
  <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
127
127
  <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
128
- <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="3"/>
129
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
130
- <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
131
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
132
- <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
128
+ <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
129
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="62"/>
130
+ <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
131
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
132
+ <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
133
133
  <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
134
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="3"/>
135
- <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
134
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="8"/>
135
+ <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="5"/>
136
136
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
137
137
  <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
138
- <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
138
+ <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="5"/>
139
139
  <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
140
140
  <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
141
141
  <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
142
142
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
143
143
  </file>
144
144
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
145
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="83"/>
146
- <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="20"/>
147
- <testCase name="calcMarginSize should threat values defined as zero" duration="7"/>
145
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="33"/>
146
+ <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
147
+ <testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
148
148
  </file>
149
149
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
150
- <testCase name="getFormattedValue should return empty string when value is null" duration="6"/>
151
- <testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
152
- <testCase name="getFormattedValue should return empty string when value is an empty array" duration="1"/>
153
- <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
150
+ <testCase name="getFormattedValue should return empty string when value is null" duration="7"/>
151
+ <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
152
+ <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
153
+ <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="2"/>
154
154
  <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
155
155
  <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
156
156
  <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
157
- <testCase name="getFormattedValue should return empty string when value is undefined" duration="4"/>
157
+ <testCase name="getFormattedValue should return empty string when value is undefined" duration="1"/>
158
158
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
159
159
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="1"/>
160
- <testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
161
- <testCase name="getFormattedValue should format numbers correctly" duration="21"/>
162
- <testCase name="getFormattedValue should format dates correctly" duration="6"/>
160
+ <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
161
+ <testCase name="getFormattedValue should format numbers correctly" duration="27"/>
162
+ <testCase name="getFormattedValue should format dates correctly" duration="7"/>
163
163
  <testCase name="getFormattedValue should format times correctly" duration="1"/>
164
164
  <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
165
- <testCase name="getFormattedValue should call toString with correct parameters" duration="33"/>
165
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
166
166
  <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
167
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
168
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="1"/>
167
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
168
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
169
169
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
170
170
  <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="1"/>
171
171
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
172
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
173
- <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
172
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
173
+ <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
174
174
  </file>
175
175
  </unitTest>
@@ -1185,35 +1185,53 @@ export default class DataUnit {
1185
1185
  *
1186
1186
  * @param selection - IDs dos registros selecionados no snapshot atual
1187
1187
  * @param executionCtx - Contexto de execução da seleção dos registros do DataUnit.
1188
- *
1189
1188
  * @returns - Informações sobre a seleção.
1190
1189
  */
1191
1190
  public updatePageSelection(selection: Array<string>, executionCtx?: ExecutionContext): Promise<SelectionInfo|undefined>{
1192
-
1193
- if(!selection){
1194
- return Promise.resolve(this.getSelectionInfo());
1195
- }
1191
+ if(!selection) return Promise.resolve(this.getSelectionInfo());
1196
1192
 
1197
1193
  return new Promise(resolve => {
1198
- const newSelection: Set<string> = new Set(getSelection(this._stateManager));
1199
- const currentRecords = getCurrentRecords(this._stateManager) || new Map();
1200
- Array.from(currentRecords.keys()).forEach(
1201
- recordId => {
1202
- if(selection.includes(recordId)){
1203
- newSelection.add(recordId);
1204
- } else {
1205
- newSelection.delete(recordId);
1206
- }
1207
- }
1208
- );
1194
+ const newSelection: Set<string> = new Set(selection);
1209
1195
 
1210
1196
  this.dispatchAction(Action.SELECTION_CHANGED, { type: "id", selection: Array.from(newSelection) }, executionCtx)
1211
- .then(()=>{
1212
- resolve(this.getSelectionInfo())
1213
- });
1197
+ .then(()=> resolve(this.getSelectionInfo()));
1214
1198
  });
1215
1199
  }
1216
1200
 
1201
+
1202
+ private updatePageSelectionAll(addRecords: boolean): Promise<SelectionInfo|undefined>{
1203
+ return new Promise(resolve => {
1204
+ const newSelection: Set<string> = new Set<string>();
1205
+
1206
+ const cachedSelection = getSelection(this._stateManager);
1207
+ cachedSelection.forEach(item => newSelection.add(item));
1208
+
1209
+ const recordsIds = this.records.map(r => r.__record__id__);
1210
+ recordsIds.forEach(id => addRecords ? newSelection.add(id): newSelection.delete(id));
1211
+
1212
+ this.dispatchAction(Action.SELECTION_CHANGED, { type: "id", selection: Array.from(newSelection) })
1213
+ .then(()=> resolve(this.getSelectionInfo()));
1214
+ });
1215
+ }
1216
+
1217
+ /**
1218
+ * Seleciona todos os registros da página.
1219
+ *
1220
+ * @returns - Informações sobre a seleção.
1221
+ */
1222
+ public selectAllRecords(): Promise<SelectionInfo|undefined>{
1223
+ return this.updatePageSelectionAll(true);
1224
+ }
1225
+
1226
+ /**
1227
+ * Desseleciona todos os registros da página.
1228
+ *
1229
+ * @returns - Informações sobre a seleção.
1230
+ */
1231
+ public unSelectAllRecords(): Promise<SelectionInfo|undefined>{
1232
+ return this.updatePageSelectionAll(false);
1233
+ }
1234
+
1217
1235
  /**
1218
1236
  *
1219
1237
  * Obtém informações sobre a seleção atual.
@@ -1,4 +1,5 @@
1
1
 
2
+ import { ChangeOperation } from "../../DataUnit.js";
2
3
  import { LoadDataRequest } from "../../loading/LoadDataRequest.js";
3
4
  import { PaginationInfo } from "../../loading/PaginationInfo.js";
4
5
  import { Action } from "../action/DataUnitAction.js";
@@ -16,6 +17,9 @@ class LoadingControlReducerImpl implements ActionReducer {
16
17
  return {...currentState, paginationInfo: action.payload?.paginationInfo};
17
18
  case Action.PAGINATION_UPDATED:
18
19
  return {...currentState, paginationInfo: action.payload};
20
+ case Action.DATA_SAVED:
21
+ return {...currentState, paginationInfo: updatePaginationInfo(stateManager, action.payload)};
22
+
19
23
  }
20
24
  return currentState;
21
25
  }
@@ -56,7 +60,45 @@ export const hasPreviousPages = (stateManager: StateManager): boolean => {
56
60
  return paginationInfo ? paginationInfo.currentPage > 0 : false;
57
61
  }
58
62
 
63
+ const updatePaginationInfo = (stateManager: StateManager, payload: Payload): PaginationInfo =>{
64
+ const paginationInfo = getPaginationInfo(stateManager);
65
+ let { records, changes } = payload;
66
+
67
+ if(!records || !changes || !paginationInfo || !validateNewRecordOperation(changes)) return paginationInfo as PaginationInfo;
68
+
69
+ const { count, firstRecord, lastRecord, total } = paginationInfo;
70
+
71
+ return {
72
+ ...paginationInfo,
73
+ count: (count ?? 0) + records.length,
74
+ firstRecord: firstRecord === 0 && records.length > 0 ? 1 : firstRecord,
75
+ lastRecord: lastRecord + records.length,
76
+ total: (total ?? 0) + records.length
77
+ }
78
+
79
+ }
80
+
81
+ const validateNewRecordOperation = (changes: Array<Change>): boolean => {
82
+ return changes.every(change => isNewRecordOperation(change._operation));
83
+ };
84
+
85
+ const isNewRecordOperation = (operation: string): operation is ChangeOperation => {
86
+ return ["INSERT", "COPY"].includes(operation);
87
+ };
88
+
59
89
  interface LoadingControlState{
60
90
  lastRequest: LoadDataRequest;
61
91
  paginationInfo: PaginationInfo;
92
+ }
93
+
94
+ interface Change {
95
+ dataUnit: string;
96
+ record: Record<string, any>;
97
+ updatingFields: Record<string, any>;
98
+ _operation: string;
99
+ }
100
+
101
+ interface Payload {
102
+ changes: Change[];
103
+ records: Record<string, any>[];
62
104
  }