Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: Tests on react-routing components #44078

Merged
merged 20 commits into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
630db7a
ui: Upgrade React version and react-dependent libraries
koorosh Jan 9, 2020
62b0bfc
ui: Resolve conflicts after rebasing against master
koorosh Jan 23, 2020
43fcde8
ui: Fix version of enzyme-react-adapter library
koorosh Jan 15, 2020
e5b9980
ui: Adjust code structure for testing routes
koorosh Jan 15, 2020
49d1bbf
ui: Fix warning messages during karma tests execution
koorosh Jan 16, 2020
522f6a0
ui: Add tests for /overview, /metrics, and /database(s) routes
koorosh Jan 16, 2020
9260955
ui: Fix linting errors
koorosh Jan 16, 2020
3e47a7d
ui: Refactor alertDateSync subscription out of App component
koorosh Jan 16, 2020
fd6252f
ui: Clean up resources after tests complete
koorosh Jan 16, 2020
db17d70
ui: Add tests for /statement(s) routes
koorosh Jan 16, 2020
094baac
ui: Add tests for /debug/* routes
koorosh Jan 16, 2020
7ba430f
ui: Add tests for /raft/* routes
koorosh Jan 16, 2020
06e7a44
ui: Add tests for /cluster/* routes
koorosh Jan 16, 2020
5f0fa45
ui: Resolve conflicts after rebasing against master branch
koorosh Jan 23, 2020
c3c13a6
ui: Fix linting error
koorosh Jan 24, 2020
ed327d0
ui: Fix conflicts after rebasing against 'ui-react-version-upgrade' b…
koorosh Jan 29, 2020
1b05059
ui: Export Connected and pure Component classes for correct unit testing
koorosh Jan 30, 2020
9ee488d
ui: Get rid of useless function wrappers
koorosh Jan 30, 2020
a32671f
ui: Fix missed routes for Statements and Decommissioned node list pages
koorosh Jan 30, 2020
043019e
ui: Add tests on routing to /reports views
koorosh Jan 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/ui/ccl/src/views/clusterviz/containers/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface ClusterVisualizationProps {
clusterDataError: Error | null;
}

class ClusterVisualization extends React.Component<ClusterVisualizationProps & RouterState & { router: InjectedRouter }> {
export class ClusterVisualization extends React.Component<ClusterVisualizationProps & RouterState & { router: InjectedRouter }> {
readonly items = [
{ value: "list", name: "Node List" },
{ value: "map", name: "Node Map" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import React from "react";
import { connect } from "react-redux";
import { withRouter, WithRouterProps } from "react-router";
import { createSelector } from "reselect";
import { Action, bindActionCreators, Dispatch } from "redux";

import { cockroach } from "src/js/protos";
import { refreshNodes, refreshLiveness, refreshLocations } from "src/redux/apiReducers";
Expand Down Expand Up @@ -121,13 +120,9 @@ export default withRouter(connect(
dataExists: selectDataExists(state),
dataErrors: dataErrors(state),
}),
(dispatch: Dispatch<Action, AdminUIState>) =>
bindActionCreators(
{
refreshNodes,
refreshLiveness,
refreshLocations,
},
dispatch,
),
{
refreshNodes,
refreshLiveness,
refreshLocations,
},
)(NodeCanvasContainer));
17 changes: 7 additions & 10 deletions pkg/ui/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,19 @@ module.exports = function(config) {
// test results reporter to use
// possible values: "dots", "progress"
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["progress"],
reporters: ["mocha", "progress"],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md
webpack: Object.assign(webpackConfig, {
devtool: "inline-source-map",
externals: {
"react/addons": true,
"react/lib/ExecutionEnvironment": true,
"react/lib/ReactContext": true,
},
mode: "none",
}),
webpack: {
devtool: "source-map",
mode: "development",
module: webpackConfig.module,
resolve: webpackConfig.resolve,
},

// "stats" needs to be copied to webpackMiddleware configuration in order
// to correctly configure console output
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"d3": "<4.0.0",
"d3-geo-projection": "^2.5.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-adapter-react-16": "^1.15.2",
"express": "^4.15.2",
"fetch-mock": "^5.9.4",
"file-loader": "^5.0.2",
Expand All @@ -94,12 +94,12 @@
"karma-mocha-reporter": "^2.2.3",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^4.0.2",
"karma-webpack": "^2.0.13",
"mocha": "^6.2.1",
"nib": "^1.1.2",
"prop-types": "^15.5.10",
"protobufjs": "^6.7.3",
"redux-saga-test-plan": "^3.6.0",
"redux-saga-test-plan": "^4.0.0-beta.2",
"rimraf": "^2.6.1",
"sinon": "^7.5.0",
"source-map-loader": "^0.2.0",
Expand Down
Loading