forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explore] fix missing CacheLabel (apache#4326)
Also adding a basic unit test.
- Loading branch information
1 parent
75a2b4f
commit 1f8fccc
Showing
2 changed files
with
48 additions
and
13 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
40 changes: 40 additions & 0 deletions
40
superset/assets/spec/javascripts/explore/components/ExploreChartHeader_spec.jsx
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,40 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import ExploreChartHeader from '../../../../javascripts/explore/components/ExploreChartHeader'; | ||
import ExploreActionButtons from '../../../../javascripts/explore/components/ExploreActionButtons'; | ||
import EditableTitle from '../../../../javascripts/components/EditableTitle'; | ||
|
||
const mockProps = { | ||
actions: {}, | ||
can_overwrite: true, | ||
can_download: true, | ||
isStarred: true, | ||
slice: {}, | ||
table_name: 'foo', | ||
form_data: {}, | ||
timeout: 1000, | ||
chart: { | ||
queryResponse: {}, | ||
}, | ||
}; | ||
|
||
describe('ExploreChartHeader', () => { | ||
let wrapper; | ||
beforeEach(() => { | ||
wrapper = shallow(<ExploreChartHeader {...mockProps} />); | ||
}); | ||
|
||
it('is valid', () => { | ||
expect( | ||
React.isValidElement(<ExploreChartHeader {...mockProps} />), | ||
).to.equal(true); | ||
}); | ||
|
||
it('renders', () => { | ||
expect(wrapper.find(EditableTitle)).to.have.lengthOf(1); | ||
expect(wrapper.find(ExploreActionButtons)).to.have.lengthOf(1); | ||
}); | ||
}); |