Skip to content

Commit b7d6a8c

Browse files
c
1 parent 60668d2 commit b7d6a8c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

packages/compass-preferences-model/src/preferences-schema.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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(''),

packages/compass-settings/src/components/settings/general.spec.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)