diff --git a/shared-data/js/helpers/__tests__/orderRuntimeParameterRangeOptions.test.ts b/shared-data/js/helpers/__tests__/orderRuntimeParameterRangeOptions.test.ts index 2a5b62b265d..ca15c35ff42 100644 --- a/shared-data/js/helpers/__tests__/orderRuntimeParameterRangeOptions.test.ts +++ b/shared-data/js/helpers/__tests__/orderRuntimeParameterRangeOptions.test.ts @@ -29,13 +29,13 @@ describe('orderRuntimeParameterRangeOptions', () => { expect(result).toEqual('16, 20') }) - it('should return alphabetical order when choices are number', () => { + it('should return the original order when range is not numerical range', () => { const mockChoices: Choice[] = [ { displayName: 'Single channel 50µL', value: 'flex_1channel_50' }, { displayName: 'Eight Channel 50µL', value: 'flex_8channel_50' }, ] const result = orderRuntimeParameterRangeOptions(mockChoices) - expect(result).toEqual('Eight Channel 50µL, Single channel 50µL') + expect(result).toEqual('Single channel 50µL, Eight Channel 50µL') }) it('should return empty string choices > 3', () => { diff --git a/shared-data/js/helpers/orderRuntimeParameterRangeOptions.ts b/shared-data/js/helpers/orderRuntimeParameterRangeOptions.ts index 826fc958dd1..289dd919b14 100644 --- a/shared-data/js/helpers/orderRuntimeParameterRangeOptions.ts +++ b/shared-data/js/helpers/orderRuntimeParameterRangeOptions.ts @@ -17,11 +17,6 @@ export const isNumeric = (str: string): boolean => { * ] * console.log(orderRuntimeParameterRangeOptions(numChoices) // 16,20 * - * const strChoices = [ - * { displayName: 'Single channel 50µL', value: 'flex_1channel_50' }, - * { displayName: 'Eight Channel 50µL', value: 'flex_8channel_50' }, - * ] - * console.log(orderRuntimeParameterRangeOptions(strChoices) // Eight Channel 50µL, Single channel 50µL */ export const orderRuntimeParameterRangeOptions = ( choices: Choice[] @@ -41,6 +36,6 @@ export const orderRuntimeParameterRangeOptions = ( }) .join(', ') } else { - return displayNames.sort().join(', ') + return displayNames.join(', ') } }