2017-06-13 23:39:16 +00:00
|
|
|
import _ from 'lodash'
|
|
|
|
|
|
|
|
import linksReducer from 'shared/reducers/links'
|
2018-01-18 03:01:16 +00:00
|
|
|
import {linksGetCompleted} from 'shared/actions/links'
|
2017-06-13 23:39:16 +00:00
|
|
|
|
|
|
|
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', () => {
|
2018-01-18 03:01:16 +00:00
|
|
|
it('can handle LINKS_GET_COMPLETED', () => {
|
2018-07-17 00:05:25 +00:00
|
|
|
const actual = linksReducer(undefined, linksGetCompleted(links))
|
2017-06-13 23:39:16 +00:00
|
|
|
const expected = links
|
2018-02-27 06:08:13 +00:00
|
|
|
expect(_.isEqual(actual, expected)).toBe(true)
|
2017-06-13 23:39:16 +00:00
|
|
|
})
|
|
|
|
})
|