-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Dashboard UX unit tests (#1603)
- Loading branch information
1 parent
4f7f437
commit c362f28
Showing
6 changed files
with
66 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
*.pyc | ||
yarn-error.log | ||
_modules | ||
superset/assets/coverage/* | ||
changelog.sh | ||
.DS_Store | ||
|
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
21 changes: 21 additions & 0 deletions
21
superset/assets/spec/javascripts/dashboard/CodeModal_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,21 @@ | ||
import React from 'react'; | ||
import CodeModal from '../../../javascripts/dashboard/components/CodeModal'; | ||
import { mount } from 'enzyme'; | ||
import { describe, it } from 'mocha'; | ||
import { expect } from 'chai'; | ||
|
||
|
||
describe('CodeModal', () => { | ||
const mockedProps = { | ||
triggerNode: <i className="fa fa-edit" />, | ||
}; | ||
it('is valid', () => { | ||
expect( | ||
React.isValidElement(<CodeModal {...mockedProps} />) | ||
).to.equal(true); | ||
}); | ||
it('renders the trigger node', () => { | ||
const wrapper = mount(<CodeModal {...mockedProps} />); | ||
expect(wrapper.find('.fa-edit')).to.have.length(1); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
superset/assets/spec/javascripts/dashboard/CssEditor_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,21 @@ | ||
import React from 'react'; | ||
import CssEditor from '../../../javascripts/dashboard/components/CssEditor'; | ||
import { mount } from 'enzyme'; | ||
import { describe, it } from 'mocha'; | ||
import { expect } from 'chai'; | ||
|
||
|
||
describe('CssEditor', () => { | ||
const mockedProps = { | ||
triggerNode: <i className="fa fa-edit" />, | ||
}; | ||
it('is valid', () => { | ||
expect( | ||
React.isValidElement(<CssEditor {...mockedProps} />) | ||
).to.equal(true); | ||
}); | ||
it('renders the trigger node', () => { | ||
const wrapper = mount(<CssEditor {...mockedProps} />); | ||
expect(wrapper.find('.fa-edit')).to.have.length(1); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
superset/assets/spec/javascripts/dashboard/RefreshIntervalModal_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,21 @@ | ||
import React from 'react'; | ||
import RefreshIntervalModal from '../../../javascripts/dashboard/components/RefreshIntervalModal'; | ||
import { mount } from 'enzyme'; | ||
import { describe, it } from 'mocha'; | ||
import { expect } from 'chai'; | ||
|
||
|
||
describe('RefreshIntervalModal', () => { | ||
const mockedProps = { | ||
triggerNode: <i className="fa fa-edit" />, | ||
}; | ||
it('is valid', () => { | ||
expect( | ||
React.isValidElement(<RefreshIntervalModal {...mockedProps} />) | ||
).to.equal(true); | ||
}); | ||
it('renders the trigger node', () => { | ||
const wrapper = mount(<RefreshIntervalModal {...mockedProps} />); | ||
expect(wrapper.find('.fa-edit')).to.have.length(1); | ||
}); | ||
}); |