2021-10-28 06:27:35 -04:00
|
|
|
/*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
|
2020-09-03 15:02:23 -04:00
|
|
|
import { configure as configureTranslation } from '@superset-ui/core';
|
fix(legacy-table): avoid React DOM (#392)
* fix(legacy-table): avoid React DOM
`jquery.datatables` will manipulate DOMs, sometimes remove them. In case
of component being reloaded with updated props, React will not be able
to find those removed nodes, causing a `cannot removeChild` error.
Because of the the way to assign row keys, if table shape changes (add
or remove columns), React may also have difficulty match the cached
nodes via keys.
In general it's a bad idea to directly manipulate React rendered DOM
nodes, so we better just let `jquery.datatables` handle everything.
In the future, once we removed `jquery.datatables`, a pure React
component will not have such issues.
* fix(legacy-table): handle the case when percentMetrics is null
* fix(legacy-table): linting errors
* refactor: use nimbus build
* test(legacy-table): add React component tests
* test(legacy-table): more sophisticated cases
* fix: address PR #392 comments
* chore(legacy-table): clean up tests case setups
Not seeing the console.warn errors anymore. So cleaning it up.
Previously it was from `<SuperChart />` component, but since we have
updated the test case to not use <SuperChart>, we are good now.
* fix(legacy-table): misleading comment
2020-03-09 15:45:33 -04:00
|
|
|
import { configure as configureEnzyme } from 'enzyme';
|
|
|
|
import EnzymeReactAdapter from 'enzyme-adapter-react-16';
|
|
|
|
|
|
|
|
configureTranslation();
|
|
|
|
configureEnzyme({ adapter: new EnzymeReactAdapter() });
|