File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
compass-preferences-model/src
compass-settings/src/components/settings Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -565,10 +565,11 @@ export const storedUserPreferencesProps: Required<{
565565 short : 'Default Sort for Query Bar' ,
566566 long : "All queries executed from the query bar will apply the sort order '$natural: -1'." ,
567567 options : {
568- '' : 'Default' ,
569- '{ $natural: -1 }' : 'Natural Order recent first' ,
570- '{ _id: 1 }' : 'ID Ascending' ,
571- '{ _id: -1 }' : 'ID Descending' ,
568+ '' : 'None (equivalent to $natural: 1, in ascending natural order of documents)' ,
569+ '{ $natural: -1 }' :
570+ '$natural: -1 (in descending natural order of documents)' ,
571+ '{ _id: 1 }' : '_id: 1 (in ascending order by creation)' ,
572+ '{ _id: -1 }' : '_id: -1 (in descending order by creation) ' ,
572573 } ,
573574 } ,
574575 validator : z . enum ( SORT_ORDER_VALUES ) . default ( '' ) ,
Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ describe('GeneralSettings', function () {
5555 } ) ;
5656 } ) ;
5757
58+ it ( 'renders defaultSortOrder' , function ( ) {
59+ expect ( within ( container ) . getByTestId ( 'defaultSortOrder' ) ) . to . exist ;
60+ } ) ;
61+
62+ it ( 'changes defaultSortOrder value when selecting an option' , function ( ) {
63+ const select = within ( container ) . getByTestId ( 'defaultSortOrder' ) ;
64+ userEvent . selectOptions ( select , '_id: 1 (in ascending order by creation)' ) ;
65+ expect ( getSettings ( ) ) . to . have . property ( 'defaultSortOrder' , '{ _id: 1 }' ) ;
66+ } ) ;
67+
5868 [ 'maxTimeMS' ] . forEach ( ( option ) => {
5969 it ( `renders ${ option } ` , function ( ) {
6070 expect ( within ( container ) . getByTestId ( option ) ) . to . exist ;
You can’t perform that action at this time.
0 commit comments