2019-03-20 16:51:09 +13:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
import { BrowserRouter, Route, IndexRoute } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
// Testing-specific
|
|
|
|
|
import renderer from 'react-test-renderer';
|
|
|
|
|
import { shallow, mount, render } from 'enzyme';
|
2019-03-22 09:02:00 +13:00
|
|
|
const state = require('../state');
|
2019-03-20 16:51:09 +13:00
|
|
|
|
|
|
|
|
// Test subjects
|
|
|
|
|
import { Album } from '../../src/js/views/Album';
|
|
|
|
|
import * as helpers from '../../src/js/helpers';
|
|
|
|
|
import * as uiActions from '../../src/js/services/ui/actions';
|
|
|
|
|
import * as coreActions from '../../src/js/services/core/actions';
|
|
|
|
|
|
|
|
|
|
describe('<Album />', () => {
|
|
|
|
|
|
2019-03-22 09:02:00 +13:00
|
|
|
var album = state.core.albums['jest:album:one'];
|
2019-03-20 16:51:09 +13:00
|
|
|
|
2019-03-22 09:02:00 +13:00
|
|
|
it('should render accurately', () => {
|
2019-03-20 16:51:09 +13:00
|
|
|
const dom = shallow(
|
|
|
|
|
<Album
|
|
|
|
|
album={album}
|
|
|
|
|
uiActions={uiActions}
|
|
|
|
|
coreActions={coreActions}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
expect(dom.find('.album-view').length).toBe(1);
|
2019-03-22 09:02:00 +13:00
|
|
|
|
|
|
|
|
expect(dom.find('h1').text()).toEqual('One');
|
|
|
|
|
expect(dom.find('.wiki__text p').text()).toEqual('Wiki text');
|
2019-03-20 16:51:09 +13:00
|
|
|
});
|
|
|
|
|
});
|