diff --git a/src/helpers/checklistFromText.test.ts b/src/helpers/checklistFromText.test.ts index 3d998139..9529e889 100644 --- a/src/helpers/checklistFromText.test.ts +++ b/src/helpers/checklistFromText.test.ts @@ -21,6 +21,7 @@ Here's some text in between expect(checkboxes[0]).toBe(0) expect(checkboxes[1]).toBe(18) expect(checkboxes[2]).toBe(69) + expect(checkboxes[3]).toBe(90) }) it('should find one checkbox with *', () => { const text: string = '* [ ] Lorem Ipsum' diff --git a/src/helpers/checklistFromText.ts b/src/helpers/checklistFromText.ts index 880c5167..65294842 100644 --- a/src/helpers/checklistFromText.ts +++ b/src/helpers/checklistFromText.ts @@ -40,7 +40,7 @@ export const findCheckboxesInText = (text: string): number[] => { return [ ...checkboxes.checked, ...checkboxes.unchecked, - ].sort() + ].sort((a, b) => a < b ? -1 : 1) } export const getChecklistStatistics = (text: string): CheckboxStatistics => {