Test linksReceived in new links reducer

temp/status_page-1556
Jared Scheib 2017-06-13 16:39:16 -07:00
parent b0a948f10e
commit 0871007fd3
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
import _ from 'lodash'
import linksReducer from 'shared/reducers/links'
import {linksReceived} from 'shared/actions/links'
import {noop} from 'shared/actions/app'
const links = {
layouts: '/chronograf/v1/layouts',
mappings: '/chronograf/v1/mappings',
sources: '/chronograf/v1/sources',
me: '/chronograf/v1/me',
dashboards: '/chronograf/v1/dashboards',
auth: [
{
name: 'github',
label: 'Github',
login: '/oauth/github/login',
logout: '/oauth/github/logout',
callback: '/oauth/github/callback',
},
],
logout: '/oauth/logout',
external: {statusFeed: 'http://pineapple.life'},
}
describe('Shared.Reducers.linksReducer', () => {
it('can handle LINKS_RECEIVED', () => {
const initial = linksReducer(undefined, noop())
const actual = linksReducer(initial, linksReceived(links))
const expected = links
expect(_.isEqual(actual, expected)).to.equal(true)
})
})