@@ -5,6 +5,7 @@ import CONST from '@src/CONST';
55import IntlStore from '@src/languages/IntlStore' ;
66import type { PolicyCategories } from '@src/types/onyx' ;
77import type { PendingAction } from '@src/types/onyx/OnyxCommon' ;
8+ import { localeCompare } from '../utils/TestHelper' ;
89import waitForBatchedUpdates from '../utils/waitForBatchedUpdates' ;
910
1011describe ( 'CategoryOptionListUtils' , ( ) => {
@@ -509,24 +510,26 @@ describe('CategoryOptionListUtils', () => {
509510
510511 const smallResult = getCategoryListSections ( {
511512 searchValue : emptySearch ,
513+ localeCompare,
512514 categories : smallCategoriesList ,
513515 } ) ;
514516 expect ( smallResult ) . toStrictEqual ( smallResultList ) ;
515517
516- const smallSearchResult = getCategoryListSections ( { searchValue : search , categories : smallCategoriesList } ) ;
518+ const smallSearchResult = getCategoryListSections ( { searchValue : search , categories : smallCategoriesList , localeCompare } ) ;
517519 expect ( smallSearchResult ) . toStrictEqual ( smallSearchResultList ) ;
518520
519- const smallWrongSearchResult = getCategoryListSections ( { searchValue : wrongSearch , categories : smallCategoriesList } ) ;
521+ const smallWrongSearchResult = getCategoryListSections ( { searchValue : wrongSearch , categories : smallCategoriesList , localeCompare } ) ;
520522 expect ( smallWrongSearchResult ) . toStrictEqual ( smallWrongSearchResultList ) ;
521523
522- const employeeSearchResult = getCategoryListSections ( { searchValue : employeeSearch , categories : smallCategoriesList } ) ;
524+ const employeeSearchResult = getCategoryListSections ( { searchValue : employeeSearch , categories : smallCategoriesList , localeCompare } ) ;
523525 expect ( employeeSearchResult ) . toStrictEqual ( employeeSearchResultList ) ;
524526
525527 const largeResult = getCategoryListSections ( {
526528 searchValue : emptySearch ,
527529 selectedOptions,
528530 categories : largeCategoriesList ,
529531 recentlyUsedCategories,
532+ localeCompare,
530533 } ) ;
531534 expect ( largeResult ) . toStrictEqual ( largeResultList ) ;
532535
@@ -535,6 +538,7 @@ describe('CategoryOptionListUtils', () => {
535538 selectedOptions,
536539 categories : largeCategoriesList ,
537540 recentlyUsedCategories,
541+ localeCompare,
538542 } ) ;
539543 expect ( largeSearchResult ) . toStrictEqual ( largeSearchResultList ) ;
540544
@@ -543,10 +547,11 @@ describe('CategoryOptionListUtils', () => {
543547 selectedOptions,
544548 categories : largeCategoriesList ,
545549 recentlyUsedCategories,
550+ localeCompare,
546551 } ) ;
547552 expect ( largeWrongSearchResult ) . toStrictEqual ( largeWrongSearchResultList ) ;
548553
549- const emptyResult = getCategoryListSections ( { searchValue : search , selectedOptions, categories : emptyCategoriesList } ) ;
554+ const emptyResult = getCategoryListSections ( { searchValue : search , selectedOptions, categories : emptyCategoriesList , localeCompare } ) ;
550555 expect ( emptyResult ) . toStrictEqual ( emptySelectedResultList ) ;
551556 } ) ;
552557
@@ -1285,8 +1290,8 @@ describe('CategoryOptionListUtils', () => {
12851290 } ,
12861291 ] ;
12871292
1288- expect ( sortCategories ( categoriesIncorrectOrdering ) ) . toStrictEqual ( result ) ;
1289- expect ( sortCategories ( categoriesIncorrectOrdering2 ) ) . toStrictEqual ( result2 ) ;
1290- expect ( sortCategories ( categoriesIncorrectOrdering3 ) ) . toStrictEqual ( result3 ) ;
1293+ expect ( sortCategories ( categoriesIncorrectOrdering , localeCompare ) ) . toStrictEqual ( result ) ;
1294+ expect ( sortCategories ( categoriesIncorrectOrdering2 , localeCompare ) ) . toStrictEqual ( result2 ) ;
1295+ expect ( sortCategories ( categoriesIncorrectOrdering3 , localeCompare ) ) . toStrictEqual ( result3 ) ;
12911296 } ) ;
12921297} ) ;
0 commit comments