Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Mar 31, 2018
1 parent 70444d1 commit 6468e08
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions dokusho/src/test/DateUtil_test.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
open Jest;

open DokuUtil;

describe("DateUtil", () => {
open Expect;

describe("DokuUtil.dateWithoutTime", () => {
test("Will remove the time data from a date", () =>
expect(DateUtil.dateWithoutTime(Js.Date.make()) |> Js.Date.getMinutes) |> toBe(0.));
});

describe("DokuUtil.asDateKey", () => {
test("Will create a string of length 16", () =>
expect(DateUtil.asDateKey(Js.Date.make()) |> String.length) |> toBe(16));
});

describe("DokuUtil.availableDates", () => {
test("Always returns a date", () =>

expect(DateUtil.availableDates({days: []}) |> Array.length) |> toBeGreaterThan(0));
});
});
2 changes: 1 addition & 1 deletion dokusho/src/test/Entry_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Entry", () => {
open ExpectJs;

test("Renders when given an entry", () => {
let entry = {id: 1, kind: Net, value: 1};
let entry = {id: 123, kind: Net, value: 123};
let component = ReactShallowRenderer.renderWithRenderer(<Entry entry=entry/>);

expect(Js.Undefined.return(component)) |> toBeDefined;
Expand Down

0 comments on commit 6468e08

Please sign in to comment.