1 jest
.dontMock('../framework/widgets/skyquake_container/skyquakeNav.jsx');
2 // /skyquake/framework/widgets/skyquake_container/skyquakeNav.jsx
3 import React
from 'react';
4 import ReactDOM
from 'react-dom';
5 import TestUtils
from 'react-addons-test-utils';
7 // import {returnLinkItem} from '../framework/widgets/skyquake_container/skyquakeNav.jsx';
9 const SkyquakeNav
= require('../framework/widgets/skyquake_container/skyquakeNav.jsx')
11 describe('SkyquakeNav', () => {
15 beforeEach(function() {
16 node
= document
.createElement('div');
18 "label": "Hello World Component 1",
19 "route": "/helloworld/#hello",
20 "component": "./helloWorldOne.jsx",
26 "label": "Hello World Component 1",
28 "component": "./helloWorldOne.jsx",
34 describe('returnLinkItem', () => {
35 it('Returns an <a> tag when external', () => {
36 let element
= SkyquakeNav
.returnLinkItem(exampleRoutes
[0]);
37 let Tag
= TestUtils
.renderIntoDocument(element
);
38 let TagNode
= ReactDOM
.findDOMNode(Tag
);
39 expect(Tag
.constructor.displayName
).toEqual("A");
40 expect(TagNode
.attributes
.href
).not
.toEqual(undefined);
42 it('Returns a <Link> tag when internal', () => {
43 let element
= SkyquakeNav
.returnLinkItem(exampleRoutes
[1]);
44 let Tag
= TestUtils
.renderIntoDocument(element
);
45 let TagNode
= ReactDOM
.findDOMNode(Tag
);
46 expect(TagNode
.constructor.displayName
).toEqual("Link");
47 expect(TagNode
.attributes
.href
).not
.toEqual(undefined);