-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a unit test for date comparison method
- Loading branch information
1 parent
e7a34ba
commit ea5fc05
Showing
1 changed file
with
19 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {checkIfDateIsLater,checkIfNumber} from "../Views/Create Event/CreateEventPage"; | ||
|
||
test("Check if dates are compared correctly. First argument must be before the second one.",()=>{ | ||
expect(checkIfDateIsLater("2014-11-30T23:00:00-08:00","2014-11-30T23:01:00-08:00")).toBe(true) | ||
expect(checkIfDateIsLater("2021-01-12T13:42:00+03:00","2021-01-12T13:41:00+03:00")).toBe(false) | ||
|
||
expect(checkIfDateIsLater("2014-11-30T22:00:00-08:00","2014-11-30T23:00:00-08:00")).toBe(true) | ||
expect(checkIfDateIsLater("2021-01-12T15:42:00+03:00","2021-01-12T14:42:00+03:00")).toBe(false) | ||
|
||
expect(checkIfDateIsLater("Sat Nov 13 10:45:00 2021","Sat Nov 14 10:45:00 2021")).toBe(true) | ||
expect(checkIfDateIsLater("12/17/1997 07:37:16.00 PST","12/16/1997 07:37:16.00 PST")).toBe(false) | ||
|
||
expect(checkIfDateIsLater("2014-11-30T23:00:00-08:00","2014-12-30T23:00:00-08:00")).toBe(true) | ||
expect(checkIfDateIsLater("2021-02-12T13:41:00+03:00","2021-01-12T13:41:00+03:00")).toBe(false) | ||
|
||
expect(checkIfDateIsLater("2014-11-30T23:00:00-08:00","2015-11-30T23:00:00-08:00")).toBe(true) | ||
expect(checkIfDateIsLater("2021-01-12T13:42:00+03:00","2020-01-12T13:42:00+03:00")).toBe(false) | ||
}) | ||
|