@sankhyalabs/core 5.20.0-dev.33 → 5.20.0-dev.35

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,149 +1,149 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
3
3
  <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
4
- <testCase name="HttpProvider Metodo GET" duration="13"/>
5
- </file>
6
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
7
- <testCase name="HttpProvider Metodo POST" duration="88"/>
4
+ <testCase name="HttpProvider Metodo GET" duration="85"/>
8
5
  </file>
9
6
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
10
- <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="383"/>
11
- <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="101"/>
7
+ <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="81"/>
8
+ <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"/>
12
9
  <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
13
10
  </file>
14
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
15
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="7"/>
16
- <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
17
- <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
18
- <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="89"/>
19
- <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"/>
20
- <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"/>
21
- <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"/>
22
- <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"/>
23
- <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"/>
24
- <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="2"/>
25
- <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"/>
26
- <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"/>
27
- <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"/>
28
- <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
11
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
12
+ <testCase name="HttpProvider Metodo POST" duration="93"/>
29
13
  </file>
30
14
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
31
- <testCase name="Mask Formatter mask:CPF complete valid" duration="91"/>
15
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="8"/>
32
16
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
33
- <testCase name="Mask Formatter mask:CPF incomplete valid" duration="2"/>
17
+ <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
34
18
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
35
19
  <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
36
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="392"/>
37
- <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
20
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="204"/>
21
+ <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="0"/>
38
22
  <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
39
- <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
23
+ <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
40
24
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
41
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
42
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="3"/>
25
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="2"/>
26
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
43
27
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
44
28
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
45
29
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
46
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
30
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
31
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
32
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
33
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
47
34
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
48
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="77"/>
49
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
50
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
51
35
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
52
36
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
53
37
  </file>
38
+ <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
39
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="107"/>
40
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="80"/>
41
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
42
+ <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"/>
43
+ <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"/>
44
+ <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"/>
45
+ <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"/>
46
+ <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="0"/>
47
+ <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="0"/>
48
+ <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="13"/>
49
+ <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"/>
50
+ <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"/>
51
+ <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="77"/>
52
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
53
+ </file>
54
54
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
55
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="3"/>
56
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
55
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
56
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
57
57
  <testCase name="TimeFormatter Case: validateTime" duration="1"/>
58
58
  </file>
59
- <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
60
- <testCase name="StringUtils valor vazio" duration="6"/>
61
- <testCase name="StringUtils valor em branco" duration="1"/>
62
- <testCase name="StringUtils valor null" duration="1"/>
63
- <testCase name="StringUtils valor undefined" duration="0"/>
64
- <testCase name="StringUtils valor 0" duration="0"/>
65
- <testCase name="StringUtils com valor" duration="2"/>
66
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
67
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="3"/>
68
- <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
59
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
60
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="65"/>
61
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
62
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="296"/>
63
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="16"/>
64
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="95"/>
65
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="16"/>
66
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="3"/>
67
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="14"/>
68
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
69
69
  </file>
70
70
  <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
71
- <testCase name="StringUtils stringToNumber" duration="13"/>
72
- <testCase name="StringUtils format" duration="107"/>
71
+ <testCase name="StringUtils stringToNumber" duration="15"/>
72
+ <testCase name="StringUtils format" duration="96"/>
73
73
  <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
74
74
  <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
75
- <testCase name="StringUtils format round number" duration="1"/>
75
+ <testCase name="StringUtils format round number" duration="77"/>
76
76
  </file>
77
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
78
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="83"/>
79
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
80
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="213"/>
81
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="95"/>
82
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="9"/>
83
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="75"/>
84
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
85
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="10"/>
86
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
77
+ <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
78
+ <testCase name="StringUtils valor vazio" duration="5"/>
79
+ <testCase name="StringUtils valor em branco" duration="1"/>
80
+ <testCase name="StringUtils valor null" duration="1"/>
81
+ <testCase name="StringUtils valor undefined" duration="1"/>
82
+ <testCase name="StringUtils valor 0" duration="1"/>
83
+ <testCase name="StringUtils com valor" duration="0"/>
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="3"/>
86
+ <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
87
87
  </file>
88
88
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
89
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="81"/>
90
- <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
89
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="8"/>
90
+ <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
91
91
  <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
92
92
  <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
93
93
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
94
- <testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="6"/>
94
+ <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"/>
95
95
  </file>
96
96
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
97
- <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="12"/>
97
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="75"/>
98
98
  <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
99
- <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
99
+ <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
100
100
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
101
101
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
102
102
  <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
103
103
  <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
104
- <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="66"/>
105
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
104
+ <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
105
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
106
106
  <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
107
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
107
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
108
108
  <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
109
- <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
110
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="5"/>
109
+ <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
110
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="6"/>
111
111
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
112
112
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
113
- <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
113
+ <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
114
114
  <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
115
115
  <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
116
- <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
117
- <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
116
+ <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="62"/>
117
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
118
118
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
119
119
  </file>
120
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
121
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="59"/>
121
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="46"/>
122
122
  <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="3"/>
123
123
  <testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
124
124
  </file>
125
125
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
126
- <testCase name="getFormattedValue should return empty string when value is null" duration="5"/>
126
+ <testCase name="getFormattedValue should return empty string when value is null" duration="4"/>
127
127
  <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
128
128
  <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
129
129
  <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
130
130
  <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
131
131
  <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
132
- <testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
132
+ <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
133
133
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
134
134
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
135
135
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
136
- <testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
137
- <testCase name="getFormattedValue should format numbers correctly" duration="13"/>
138
- <testCase name="getFormattedValue should format dates correctly" duration="4"/>
136
+ <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
137
+ <testCase name="getFormattedValue should format numbers correctly" duration="10"/>
138
+ <testCase name="getFormattedValue should format dates correctly" duration="19"/>
139
139
  <testCase name="getFormattedValue should format times correctly" duration="1"/>
140
- <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
141
- <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
140
+ <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
141
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
142
142
  <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
143
143
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
144
144
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
145
145
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
146
- <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
146
+ <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="1"/>
147
147
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
148
148
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
149
149
  <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
@@ -26,6 +26,7 @@ import { v4 as uuid } from "uuid";
26
26
  import { DataUnitStorage } from "./DataUnitStorage.js";
27
27
  import { getInvalidFieldMessage, InvalidFieldsReducer } from "./state/slice/InvalidFieldsSlice.js";
28
28
  import { getLoadingProperties, LoadingPropertiesReducer } from "./state/slice/LoadingProperties.js";
29
+ import SortingUtils from "../utils/SortingUtils.js";
29
30
 
30
31
  /***
31
32
  * `DataUnit`: Atua como uma camada de abstração entre o back-end e a interface do usuário.
@@ -1170,6 +1171,12 @@ export default class DataUnit {
1170
1171
  public getSelectionInfo(): SelectionInfo{
1171
1172
  const selectionInfo: SelectionInfo = getSelectionInfo(this._stateManager);
1172
1173
  selectionInfo.getAllRecords = () => this.allRecordsLoader?.(this);
1174
+
1175
+ if (selectionInfo.sort != undefined && selectionInfo.sort.length > 0) {
1176
+ const sortingFunction = SortingUtils.getSortingFunction(this, selectionInfo.sort)
1177
+ selectionInfo.records?.sort(sortingFunction)
1178
+ }
1179
+
1173
1180
  return selectionInfo;
1174
1181
  }
1175
1182
 
@@ -1184,6 +1191,15 @@ export default class DataUnit {
1184
1191
  return getSelectedRecord(this._stateManager);
1185
1192
  }
1186
1193
 
1194
+ /**
1195
+ * Retorna o DataUnit pai
1196
+ *
1197
+ * @returns DataUnit pai ou undefined
1198
+ */
1199
+ public getParentDataUnit(): DataUnit | undefined {
1200
+ return this._parentDataUnit;
1201
+ }
1202
+
1187
1203
  /**
1188
1204
  *
1189
1205
  * Limpa todos os registros do DataUnit
@@ -94,8 +94,8 @@ export const getSelection = (stateManager: StateManager): Array<string> => {
94
94
  export const getSelectionInfo = (stateManager: StateManager): SelectionInfo => {
95
95
 
96
96
  const selection = getSelectionState(stateManager);
97
+ const currentRequest = getCurrentRequest(stateManager);
97
98
  if(selection && selection.mode === SelectionMode.ALL_RECORDS){
98
- const currentRequest = getCurrentRequest(stateManager);
99
99
  const paginationInfo: PaginationInfo | undefined = getPaginationInfo(stateManager);
100
100
  return new SelectionInfo(
101
101
  [],
@@ -106,7 +106,7 @@ export const getSelectionInfo = (stateManager: StateManager): SelectionInfo => {
106
106
  );
107
107
  }
108
108
 
109
- return new SelectionInfo(getSelectionRecords(stateManager) || [], SelectionMode.SOME_RECORDS, undefined);
109
+ return new SelectionInfo(getSelectionRecords(stateManager) || [], SelectionMode.SOME_RECORDS, undefined, undefined, currentRequest?.sort);
110
110
  }
111
111
 
112
112
  export const hasNext = (stateManager: StateManager): boolean => {
@@ -0,0 +1,30 @@
1
+ import DataUnit from "../dataunit/DataUnit.js";
2
+ import { FieldDescriptor, Sort, SortMode } from "../dataunit/metadata/UnitMetadata.js";
3
+ import { FieldComparator } from "../dataunit/sorting/FieldComparator.js";
4
+ import { Record } from '../dataunit/DataUnit.js';
5
+
6
+ /**
7
+ * `SortingUtils`: Utilizado para auxiliar na ordenacao de registros.
8
+ */
9
+ export default class SortingUtils {
10
+
11
+ public static getSortingFunction(dataUnit: DataUnit, sorting?: Array<Sort>): ((recordA: Record, recordB: Record) => number) | undefined {
12
+
13
+ if (sorting == undefined || sorting.length == 0) {
14
+ return undefined;
15
+ }
16
+
17
+ return (recordA, recordB) => {
18
+ for (const sort of sorting) {
19
+ if (sort.field){
20
+ const result = FieldComparator.compare(dataUnit.getField(sort.field) as FieldDescriptor, recordA, recordB, sort.mode === SortMode.ASC);
21
+ if (result != 0) {
22
+ return result;
23
+ }
24
+ }
25
+ }
26
+ return 0;
27
+ };
28
+ }
29
+
30
+ }