@@ -119,30 +119,30 @@ describe('helpers.ts', () => {
119
119
const element = [ "ordering_field" ] ;
120
120
const returnValue = getSortsArrayFromOrdering ( element ) ;
121
121
122
- expect ( returnValue ) . toEqual ( { sortBy : [ "ordering_field" ] , sortDesc : [ false ] } )
122
+ expect ( returnValue ) . toEqual ( { sortBy : [ { key : "ordering_field" , order : "asc" } ] , sortDesc : [ ] } )
123
123
} )
124
124
125
125
it ( "return correct VuetifySortArraysObject if negative ordering" , ( ) => {
126
126
const element = [ "-ordering_field" ] ;
127
127
const returnValue = getSortsArrayFromOrdering ( element ) ;
128
128
129
- expect ( returnValue ) . toEqual ( { sortBy : [ "ordering_field" ] , sortDesc : [ true ] } )
129
+ expect ( returnValue ) . toEqual ( { sortBy : [ { key : "ordering_field" , order : "desc" } ] , sortDesc : [ ] } )
130
130
} )
131
131
} )
132
132
133
133
describe ( 'getOrderingFromSortArray' , ( ) => {
134
134
135
135
it ( "return correct ordering if positive ordering" , ( ) => {
136
- const sortBy = [ "ordering_field" ] ;
137
- const sortDesc = [ false ] ;
136
+ const sortBy : { key : string ; order : 'asc' | 'desc' ; } [ ] = [ { key : "ordering_field" , order : "asc" } ] ;
137
+ const sortDesc : boolean [ ] = [ ] ;
138
138
const returnValue = getOrderingFromSortArray ( sortBy , sortDesc ) ;
139
139
140
140
expect ( returnValue ) . toEqual ( [ "ordering_field" ] )
141
141
} )
142
142
143
143
it ( "return correct ordering if negative ordering" , ( ) => {
144
- const sortBy = [ "ordering_field" ] ;
145
- const sortDesc = [ true ] ;
144
+ const sortBy : { key : string ; order : 'asc' | 'desc' ; } [ ] = [ { key : "ordering_field" , order : "desc" } ] ;
145
+ const sortDesc : boolean [ ] = [ ] ;
146
146
const returnValue = getOrderingFromSortArray ( sortBy , sortDesc ) ;
147
147
148
148
expect ( returnValue ) . toEqual ( [ "-ordering_field" ] )
0 commit comments