Skip to content

Commit d4bf16e

Browse files
committed
Add tests for TS value and defaultValue
From arqex#297
1 parent c6bf905 commit d4bf16e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

typings/react-datetime-tests.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from "react";
22
import { Moment } from "moment";
3+
import * as moment from "moment";
34
import * as ReactDatetime from "react-datetime";
45

56
/*
@@ -20,6 +21,22 @@ const TEST_DATE_PROPS_FOR_DEFAULT_VALUE: JSX.Element = <ReactDatetime
2021
defaultValue={ new Date() }
2122
/>;
2223

24+
const TEST_DATE_PROPS_FOR_VALUE_AS_MOMENT: JSX.Element = <ReactDatetime
25+
value={ moment() }
26+
/>;
27+
28+
const TEST_DATE_PROPS_FOR_VALUE_AS_STRING: JSX.Element = <ReactDatetime
29+
value={ '1995-12-25' }
30+
/>;
31+
32+
const TEST_DATE_PROPS_FOR_DEFAULT_VALUE_AS_MOMENT: JSX.Element = <ReactDatetime
33+
defaultValue={ moment() }
34+
/>;
35+
36+
const TEST_DATE_PROPS_FOR_DEFAULT_VALUE_AS_STRING: JSX.Element = <ReactDatetime
37+
defaultValue={ '1995-12-25' }
38+
/>;
39+
2340
/*
2441
Test formats
2542
*/

0 commit comments

Comments
 (0)