Test cleanup
parent
a861c7a862
commit
9abbce4160
|
@ -41,9 +41,10 @@ describe('Dashboards.Reducers.DashTimeV1', () => {
|
|||
expect(actual.ranges).to.deep.equal(expected)
|
||||
})
|
||||
|
||||
it('can update a dashboard time range', () => {
|
||||
describe('setting a dashboard time range', () => {
|
||||
it('can update an existing dashboard', () => {
|
||||
const state = {
|
||||
ranges: [{dashboardID, timeRange}],
|
||||
ranges: [{dashboardID, upper: timeRange.upper, lower: timeRange.lower}],
|
||||
}
|
||||
|
||||
const {upper, lower} = {
|
||||
|
@ -51,9 +52,26 @@ describe('Dashboards.Reducers.DashTimeV1', () => {
|
|||
lower: '2017-10-05 12:04',
|
||||
}
|
||||
|
||||
const actual = reducer(state, updateDashTimeV1(dashboardID, {upper, lower}))
|
||||
const actual = reducer(
|
||||
state,
|
||||
updateDashTimeV1(dashboardID, {upper, lower})
|
||||
)
|
||||
const expected = [{dashboardID, upper, lower}]
|
||||
|
||||
expect(actual.ranges).to.deep.equal(expected)
|
||||
})
|
||||
|
||||
it('can set a new time range if none exists', () => {
|
||||
const actual = reducer(
|
||||
emptyState,
|
||||
updateDashTimeV1(dashboardID, timeRange)
|
||||
)
|
||||
|
||||
const expected = [
|
||||
{dashboardID, upper: timeRange.upper, lower: timeRange.lower},
|
||||
]
|
||||
|
||||
expect(actual.ranges).to.deep.equal(expected)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue