mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 14:29:48 +02:00
test(ganttDb.spec): add simple tests for the durationToDate fn
This commit is contained in:
@@ -7,6 +7,16 @@ describe('when using the ganttDb', function () {
|
|||||||
ganttDb.clear()
|
ganttDb.clear()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('when using relative times', function () {
|
||||||
|
it.each`
|
||||||
|
diff | date | expected
|
||||||
|
${' 1d'} | ${moment('2019-01-01')} | ${moment('2019-01-02').toDate()}
|
||||||
|
${' 1w'} | ${moment('2019-01-01')} | ${moment('2019-01-08').toDate()}
|
||||||
|
`('should add $diff to $date resulting in $expected', ({ diff, date, expected }) => {
|
||||||
|
expect(ganttDb.durationToDate(diff, date)).toEqual(expected)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('when calling the clear function', function () {
|
describe('when calling the clear function', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
ganttDb.setDateFormat('YYYY-MM-DD')
|
ganttDb.setDateFormat('YYYY-MM-DD')
|
||||||
|
Reference in New Issue
Block a user