@@ -7,7 +7,7 @@ describe('sort', () => {
7
7
const data = [ [ 1 ] , [ 3 ] , [ 4 ] , [ 2 ] ] ;
8
8
const sorted = sort (
9
9
data ,
10
- [ { columnId : 0 , direction : SortDirection . Descending } ]
10
+ [ { column_id : 0 , direction : SortDirection . Descending } ]
11
11
) ;
12
12
13
13
expect ( sorted . length ) . to . equal ( data . length ) ;
@@ -22,7 +22,7 @@ describe('sort', () => {
22
22
23
23
const sorted = sort (
24
24
data ,
25
- [ { columnId : 0 , direction : SortDirection . Descending } ]
25
+ [ { column_id : 0 , direction : SortDirection . Descending } ]
26
26
) ;
27
27
28
28
expect ( sorted . length ) . to . equal ( data . length ) ;
@@ -40,7 +40,7 @@ describe('sort', () => {
40
40
41
41
const sorted = sort (
42
42
data ,
43
- [ { columnId : 0 , direction : SortDirection . Ascending } ]
43
+ [ { column_id : 0 , direction : SortDirection . Ascending } ]
44
44
) ;
45
45
46
46
expect ( sorted . length ) . to . equal ( data . length ) ;
@@ -58,7 +58,7 @@ describe('sort', () => {
58
58
59
59
const sorted = sort (
60
60
data ,
61
- [ { columnId : 0 , direction : SortDirection . Descending } ]
61
+ [ { column_id : 0 , direction : SortDirection . Descending } ]
62
62
) ;
63
63
64
64
expect ( sorted . length ) . to . equal ( data . length ) ;
@@ -76,7 +76,7 @@ describe('sort', () => {
76
76
77
77
const sorted = sort (
78
78
data ,
79
- [ { columnId : 0 , direction : SortDirection . Ascending } ]
79
+ [ { column_id : 0 , direction : SortDirection . Ascending } ]
80
80
) ;
81
81
82
82
expect ( sorted . length ) . to . equal ( data . length ) ;
@@ -105,8 +105,8 @@ describe('sort', () => {
105
105
const sorted = sort (
106
106
data ,
107
107
[
108
- { columnId : 0 , direction : SortDirection . Descending } ,
109
- { columnId : 1 , direction : SortDirection . Descending }
108
+ { column_id : 0 , direction : SortDirection . Descending } ,
109
+ { column_id : 1 , direction : SortDirection . Descending }
110
110
]
111
111
) ;
112
112
@@ -135,8 +135,8 @@ describe('sort', () => {
135
135
const sorted = sort (
136
136
data ,
137
137
[
138
- { columnId : 1 , direction : SortDirection . Descending } ,
139
- { columnId : 0 , direction : SortDirection . Ascending }
138
+ { column_id : 1 , direction : SortDirection . Descending } ,
139
+ { column_id : 0 , direction : SortDirection . Ascending }
140
140
]
141
141
) ;
142
142
@@ -153,48 +153,48 @@ describe('sort', () => {
153
153
describe ( 'sorting settings' , ( ) => {
154
154
describe ( 'single column sorting' , ( ) => {
155
155
it ( 'new descending' , ( ) => {
156
- const settings = singleUpdateSettings ( [ ] , { columnId : 0 , direction : SortDirection . Descending } ) ;
156
+ const settings = singleUpdateSettings ( [ ] , { column_id : 0 , direction : SortDirection . Descending } ) ;
157
157
158
158
expect ( settings . length ) . to . equal ( 1 ) ;
159
- expect ( settings [ 0 ] . columnId ) . to . equal ( 0 ) ;
159
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 0 ) ;
160
160
expect ( settings [ 0 ] . direction ) . to . equal ( SortDirection . Descending ) ;
161
161
} ) ;
162
162
163
163
it ( 'update to descending' , ( ) => {
164
164
const settings = singleUpdateSettings (
165
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
166
- { columnId : 0 , direction : SortDirection . Descending }
165
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
166
+ { column_id : 0 , direction : SortDirection . Descending }
167
167
) ;
168
168
169
169
expect ( settings . length ) . to . equal ( 1 ) ;
170
- expect ( settings [ 0 ] . columnId ) . to . equal ( 0 ) ;
170
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 0 ) ;
171
171
expect ( settings [ 0 ] . direction ) . to . equal ( SortDirection . Descending ) ;
172
172
} ) ;
173
173
174
174
it ( 'remove by setting to None' , ( ) => {
175
175
const settings = singleUpdateSettings (
176
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
177
- { columnId : 0 , direction : SortDirection . None }
176
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
177
+ { column_id : 0 , direction : SortDirection . None }
178
178
) ;
179
179
180
180
expect ( settings . length ) . to . equal ( 0 ) ;
181
181
} ) ;
182
182
183
183
it ( 'replace with other' , ( ) => {
184
184
const settings = singleUpdateSettings (
185
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
186
- { columnId : 1 , direction : SortDirection . Ascending }
185
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
186
+ { column_id : 1 , direction : SortDirection . Ascending }
187
187
) ;
188
188
189
189
expect ( settings . length ) . to . equal ( 1 ) ;
190
- expect ( settings [ 0 ] . columnId ) . to . equal ( 1 ) ;
190
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 1 ) ;
191
191
expect ( settings [ 0 ] . direction ) . to . equal ( SortDirection . Ascending ) ;
192
192
} ) ;
193
193
194
194
it ( 'replace with None' , ( ) => {
195
195
const settings = singleUpdateSettings (
196
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
197
- { columnId : 1 , direction : SortDirection . None }
196
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
197
+ { column_id : 1 , direction : SortDirection . None }
198
198
) ;
199
199
200
200
expect ( settings . length ) . to . equal ( 0 ) ;
@@ -203,65 +203,65 @@ describe('sorting settings', () => {
203
203
204
204
describe ( 'multi columns sorting' , ( ) => {
205
205
it ( 'new descending' , ( ) => {
206
- const settings = multiUpdateSettings ( [ ] , { columnId : 0 , direction : SortDirection . Descending } ) ;
206
+ const settings = multiUpdateSettings ( [ ] , { column_id : 0 , direction : SortDirection . Descending } ) ;
207
207
208
208
expect ( settings . length ) . to . equal ( 1 ) ;
209
- expect ( settings [ 0 ] . columnId ) . to . equal ( 0 ) ;
209
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 0 ) ;
210
210
expect ( settings [ 0 ] . direction ) . to . equal ( SortDirection . Descending ) ;
211
211
} ) ;
212
212
213
213
it ( 'update to descending' , ( ) => {
214
214
const settings = multiUpdateSettings (
215
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
216
- { columnId : 0 , direction : SortDirection . Descending }
215
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
216
+ { column_id : 0 , direction : SortDirection . Descending }
217
217
) ;
218
218
219
219
expect ( settings . length ) . to . equal ( 1 ) ;
220
- expect ( settings [ 0 ] . columnId ) . to . equal ( 0 ) ;
220
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 0 ) ;
221
221
expect ( settings [ 0 ] . direction ) . to . equal ( SortDirection . Descending ) ;
222
222
} ) ;
223
223
224
224
it ( 'remove by setting to None' , ( ) => {
225
225
const settings = multiUpdateSettings (
226
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
227
- { columnId : 0 , direction : SortDirection . None }
226
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
227
+ { column_id : 0 , direction : SortDirection . None }
228
228
) ;
229
229
230
230
expect ( settings . length ) . to . equal ( 0 ) ;
231
231
} ) ;
232
232
233
233
it ( 'respects order' , ( ) => {
234
234
const settings = multiUpdateSettings (
235
- [ { columnId : 0 , direction : SortDirection . Ascending } ] ,
236
- { columnId : 1 , direction : SortDirection . Ascending }
235
+ [ { column_id : 0 , direction : SortDirection . Ascending } ] ,
236
+ { column_id : 1 , direction : SortDirection . Ascending }
237
237
) ;
238
238
239
239
expect ( settings . length ) . to . equal ( 2 ) ;
240
- expect ( settings [ 0 ] . columnId ) . to . equal ( 0 ) ;
241
- expect ( settings [ 1 ] . columnId ) . to . equal ( 1 ) ;
240
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 0 ) ;
241
+ expect ( settings [ 1 ] . column_id ) . to . equal ( 1 ) ;
242
242
} ) ;
243
243
244
244
it ( 'respects order when removed and added back' , ( ) => {
245
- let settings : SortSettings = [ { columnId : 0 , direction : SortDirection . Ascending } ] ;
245
+ let settings : SortSettings = [ { column_id : 0 , direction : SortDirection . Ascending } ] ;
246
246
247
247
settings = multiUpdateSettings (
248
248
settings ,
249
- { columnId : 1 , direction : SortDirection . Ascending }
249
+ { column_id : 1 , direction : SortDirection . Ascending }
250
250
) ;
251
251
252
252
settings = multiUpdateSettings (
253
253
settings ,
254
- { columnId : 0 , direction : SortDirection . None }
254
+ { column_id : 0 , direction : SortDirection . None }
255
255
) ;
256
256
257
257
settings = multiUpdateSettings (
258
258
settings ,
259
- { columnId : 0 , direction : SortDirection . Ascending }
259
+ { column_id : 0 , direction : SortDirection . Ascending }
260
260
) ;
261
261
262
262
expect ( settings . length ) . to . equal ( 2 ) ;
263
- expect ( settings [ 0 ] . columnId ) . to . equal ( 1 ) ;
264
- expect ( settings [ 1 ] . columnId ) . to . equal ( 0 ) ;
263
+ expect ( settings [ 0 ] . column_id ) . to . equal ( 1 ) ;
264
+ expect ( settings [ 1 ] . column_id ) . to . equal ( 0 ) ;
265
265
} ) ;
266
266
} ) ;
267
267
} ) ;
0 commit comments