forked from obsidian-tasks-group/obsidian-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up fix of recurring tasks without a date
Added new test file for recurrence.
- Loading branch information
Showing
3 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import moment from 'moment'; | ||
import { Recurrence } from '../src/Recurrence'; | ||
|
||
jest.mock('obsidian'); | ||
window.moment = moment; | ||
|
||
describe('Recurrence', () => { | ||
it('creates a recurring instance even if no date is given', () => { | ||
// Arrange | ||
const recurrence = Recurrence.fromText({ | ||
recurrenceRuleText: 'every week', | ||
startDate: null, | ||
scheduledDate: null, | ||
dueDate: null, | ||
}); | ||
|
||
// Act | ||
const next = recurrence!.next(); | ||
|
||
// Assert | ||
expect(next).toStrictEqual({ | ||
startDate: null, | ||
scheduledDate: null, | ||
dueDate: null, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters