-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explore-v2] hook up ExploreViewContainer to state and add specs (#1300)
* add getParams func to common * get data from redux state * specs for chart container and explore view container
- Loading branch information
Alanna Scott
authored
Oct 10, 2016
1 parent
f8e2ce6
commit fe66557
Showing
7 changed files
with
118 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
caravel/assets/spec/javascripts/explorev2/components/ChartContainer_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
|
||
import ChartContainer from '../../../../javascripts/explorev2/components/ChartContainer'; | ||
|
||
describe('ChartContainer', () => { | ||
const mockProps = { | ||
data: [ | ||
{ | ||
classed: '', | ||
key: 'Label 1', | ||
values: [ | ||
{ | ||
x: -158766400000, | ||
y: 57, | ||
}, | ||
{ | ||
x: -156766400000, | ||
y: 157, | ||
}, | ||
{ | ||
x: -157766400000, | ||
y: 257, | ||
}, | ||
], | ||
}, | ||
], | ||
sliceName: 'Trend Line', | ||
vizType: 'line', | ||
height: '500px', | ||
}; | ||
|
||
it('renders when vizType is line', () => { | ||
expect( | ||
React.isValidElement(<ChartContainer {...mockProps} />) | ||
).to.equal(true); | ||
}); | ||
}); |
36 changes: 36 additions & 0 deletions
36
caravel/assets/spec/javascripts/explorev2/components/ExploreViewContainer_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import ExploreViewContainer | ||
from '../../../../javascripts/explorev2/components/ExploreViewContainer'; | ||
import QueryAndSaveButtons | ||
from '../../../../javascripts/explorev2/components/QueryAndSaveButtons'; | ||
import ControlPanelsContainer | ||
from '../../../../javascripts/explorev2/components/ControlPanelsContainer'; | ||
import ChartContainer | ||
from '../../../../javascripts/explorev2/components/ChartContainer'; | ||
|
||
describe('ExploreViewContainer', () => { | ||
it('renders', () => { | ||
expect( | ||
React.isValidElement(<ExploreViewContainer />) | ||
).to.equal(true); | ||
}); | ||
|
||
it('renders QueryAndSaveButtons', () => { | ||
const wrapper = shallow(<ExploreViewContainer />); | ||
expect(wrapper.find(QueryAndSaveButtons)).to.have.length(1); | ||
}); | ||
|
||
it('renders ControlPanelsContainer', () => { | ||
const wrapper = shallow(<ExploreViewContainer />); | ||
expect(wrapper.find(ControlPanelsContainer)).to.have.length(1); | ||
}); | ||
|
||
it('renders ChartContainer', () => { | ||
const wrapper = shallow(<ExploreViewContainer />); | ||
expect(wrapper.find(ChartContainer)).to.have.length(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters