-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from gabrielburnworth/master
WeekRow test
- Loading branch information
Showing
2 changed files
with
49 additions
and
7 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,39 @@ | ||
import * as React from "react"; | ||
import { render } from "enzyme"; | ||
import { WeekRow } from "../bulk_scheduler/week_row"; | ||
import { WeekRowProps } from "../bulk_scheduler/interfaces"; | ||
import { betterMerge } from "../../util"; | ||
|
||
function weekProps(p?: Partial<WeekRowProps>): WeekRowProps { | ||
return betterMerge({ | ||
dispatch: jest.fn(), | ||
index: 0, | ||
week: { | ||
"days": { | ||
"day1": false, | ||
"day2": false, | ||
"day3": false, | ||
"day4": false, | ||
"day5": false, | ||
"day6": false, | ||
"day7": false | ||
} | ||
} | ||
}, p || {}); | ||
} | ||
|
||
describe("<WeekRow/>", () => { | ||
it("renders week 1 day numbers", () => { | ||
const wrapper = render(<WeekRow {...weekProps() } />); | ||
let txt = wrapper.text(); | ||
expect(txt).toEqual("Week 11234567"); | ||
}); | ||
}); | ||
|
||
describe("<WeekRow/>", () => { | ||
it("renders week 2 day numbers", () => { | ||
const wrapper = render(<WeekRow {...weekProps({ index: 1 }) } />); | ||
let txt = wrapper.text(); | ||
expect(txt).toEqual("Week 2891011121314"); | ||
}); | ||
}); |