@@ -1090,19 +1090,9 @@ describe('order of recurring tasks', () => {
1090
1090
resetSettings ( ) ;
1091
1091
} ) ;
1092
1092
1093
- function togglingInUsersOrderShouldGive ( line : string , expectedLines : string [ ] ) {
1094
- // Arrange
1095
- const task = fromLine ( { line : line } ) ;
1096
-
1097
- // Act
1098
- const lines = task . toggleWithRecurrenceInUsersOrder ( ) . map ( ( t ) => t . toFileLineString ( ) ) ;
1099
-
1100
- // Assert
1101
- expect ( lines ) . toStrictEqual ( expectedLines ) ;
1102
- }
1103
-
1104
1093
it ( 'should put new task before old, by default' , ( ) => {
1105
- togglingInUsersOrderShouldGive ( '- [ ] this is a recurring task π every day' , [
1094
+ const line = '- [ ] this is a recurring task π every day' ;
1095
+ expect ( line ) . toToggleWithRecurrenceInUsersOrderTo ( [
1106
1096
'- [ ] this is a recurring task π every day' ,
1107
1097
'- [x] this is a recurring task π every day β
2023-05-16' ,
1108
1098
] ) ;
@@ -1111,7 +1101,8 @@ describe('order of recurring tasks', () => {
1111
1101
it ( 'should honour new-task-before-old setting' , ( ) => {
1112
1102
updateSettings ( { recurrenceOnNextLine : false } ) ;
1113
1103
1114
- togglingInUsersOrderShouldGive ( '- [ ] this is a recurring task π every day' , [
1104
+ const line = '- [ ] this is a recurring task π every day' ;
1105
+ expect ( line ) . toToggleWithRecurrenceInUsersOrderTo ( [
1115
1106
'- [ ] this is a recurring task π every day' ,
1116
1107
'- [x] this is a recurring task π every day β
2023-05-16' ,
1117
1108
] ) ;
@@ -1120,7 +1111,8 @@ describe('order of recurring tasks', () => {
1120
1111
it ( 'should honour old-task-before-new setting' , ( ) => {
1121
1112
updateSettings ( { recurrenceOnNextLine : true } ) ;
1122
1113
1123
- togglingInUsersOrderShouldGive ( '- [ ] this is a recurring task π every day' , [
1114
+ const line = '- [ ] this is a recurring task π every day' ;
1115
+ expect ( line ) . toToggleWithRecurrenceInUsersOrderTo ( [
1124
1116
'- [x] this is a recurring task π every day β
2023-05-16' ,
1125
1117
'- [ ] this is a recurring task π every day' ,
1126
1118
] ) ;
0 commit comments