Commit Graph

7 Commits

Author SHA1 Message Date
Krist Wongsuphasawat
5c02e3199b Implement SuperChart and enable the chart plugins (#6154)
* setup plugin and add SuperChart

* Integrate SuperChart into Chart.jsx

* Add vizType as class name

* Remove .slice_container

* add snakeCase to sanitize class name

* Remove old code to load charts

* Fix supportedAnnotationTypes

* Update AnnotationTypes, remove unnecessary imports and dependency from VIZ_TYPES

* remove index.js and update unit test

* resolve tree map issue

* fix issue with annotation types

* fix proptypes

* add )

* address a few comments

* create bound functions

* bound more functions

* add reselect

* use reselect for chartprops

* improve performance with reselect

* remove unused props

* Remove getFilters() and update table test

* Remove unused code

* Delete adaptors

* switch to react-loadable

* Rewrite with reloadable

* Add timeout back

* remove loading

* update table unit test

* remove pastDelay
2018-10-26 11:38:30 -07:00
Christine Chambers
9029701f24 [refactor] Migrate from Mocha+Chai to Jest (#6079)
* [refactor] Migrate from Mocha+Chai to Jest

This change migrates all the existing unit tests
- to Jest's global expect and matchers from chai's imported expect, asserts and matchers.
- to Jest's describe/test from mocha's describe/it

The majority of the mechanical changes to tests are achieved through running jest-codemods. The only two note-worthy manual tweaks:
1. Setting a testURL of http://localhost in jest config and adjusting a few tests to leverage this value instead of relying on about:blank.
2. Re-enabling ExploreChartPanel_spec which was previously commented out as we cannot have empty tests with nothing in it with Jest. :)

This change also removes dependencies to Mocha and Chai.

* Remove the test:one command as it now does the same thing as test.

* Fixing lint errors. The diff looks large but is large done through `yarn run lint --fix`

The only noteworthy change is the one in eslintrc for tests. The env has been updated from mocha to jest.

* Adding eslint-plugin-jest and further modify tests.

- One small fix in sqllab's Timer Spec for a test that is not using the spy it created for testing.
- Deletion of a duplicated test caught by eslint-plugin-jest.

* - Make istanbul coverage work with Jest.

- Remove dependency on stand-alone istanbul and babel-istanbul as they're built-into jest. Yes!

* Attempt to fix dynamic imports in tests.

* run sequentially and log heap usage

* - tweaking maxworkers for travis and specifying coverageDirectory for codecov

- remove dynamic import in shim.js now that it is set in babelrc for tests only.
2018-10-15 13:10:18 -07:00
Krist Wongsuphasawat
2cd9407a50 [SIP-6] Migrate visualizations to new directory structure. (#5949)
* Migrate Chord, Calendar

* Migrate CountryMap

* Add display name and rename Chord.jsx to Chord.js

* migrate Histogram

* add force-directed

* migrate Heatmap

* add horizon

* migrate parallel coordinates

* migrate partition

* migrate pivot table

* migrate rose

* remove react-dom

* migrate Sankey

* migrate sunburst

* migrate table

* migrate treemap

* migrate filterbox

* migrate wordcloud

* add paired t-test

* fix unit test

* remove renaming

* rename fields
2018-09-27 14:39:56 -07:00
Chris Williams
b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00
Maxime Beauchemin
73db918fbe Upgrade to React==16.4.1 & Enzyme==3.3.0 (#5359)
* Bumping react==16.4.1 &  enzyme==3.3.0

The upgrade was pretty smooth except for a cryptic message coming
out of react-select around running multiple copies of React. It turns
out the `common` bundle had React and was conflicting with explore and
dashboard apps, only in 16.x. This somehow wasn't a problem in 15.x
outside of the wasted resources.

Running 16.4 should bring in all sorts of perf improvements and features
we've all been waiting for.

https://reactjs.org/blog/2017/09/26/react-v16.0.html

TODO: react-bootstrap-datetimepicker isn't compatible with React 16

* Trying to deprecate react-bootstrap-datetime

* Moving forward

* Reintroducing tests
2018-09-10 14:48:06 -07:00
Krist Wongsuphasawat
8a4b1b7c25 [SIP-5] Refactor table (#5707)
* update indent

* extract formData and data.

* take filter

* remove dependencies

* remove removeFilter

* add comment

* remove columnFormats and verboseMap from props. clarify a few more props

* fix linting issue

* minor syntax

* syntax fix

* Move check to adaptor

* update unit test

* remove code related to .widget

* rename variables for clarity

* move Option fix to browser.js
2018-08-31 15:42:44 -07:00
Beto Dealmeida
2da5db9fcd [Table view] Handle empty arrays in fd.timeseries_limit_metric (#5715)
* Handle empty arrays

* Remove test code

* Adding unit test

* Fix unit tests

* Remove logging
2018-08-28 18:42:48 -07:00