chore: Make font-weights themable, fix font faces (#19236)

* fix(fonts): Import all necessary font packages

* Make html tags themable

* Set bold font weight to 600, add medium font weight to theme

* Replace hard coded font weights with theme variables

* Change some font weight light elements to normal

* Fix tests

* Fix bug in pivot table

* Address code review comments
This commit is contained in:
Kamil Gabryjelski
2022-03-22 09:36:15 +01:00
committed by GitHub
parent 35b8a72dae
commit a8a48af7fa
29 changed files with 523 additions and 452 deletions

View File

@@ -17,13 +17,18 @@
* under the License.
*/
import React from 'react';
import { mount } from 'enzyme';
import React, { ReactElement } from 'react';
import mockConsole, { RestoreConsole } from 'jest-mock-console';
import { triggerResizeObserver } from 'resize-observer-polyfill';
import ErrorBoundary from 'react-error-boundary';
import { promiseTimeout, SuperChart } from '@superset-ui/core';
import {
promiseTimeout,
SuperChart,
supersetTheme,
ThemeProvider,
} from '@superset-ui/core';
import { mount as enzymeMount } from 'enzyme';
import RealSuperChart, {
WrapperProps,
} from '../../../src/chart/components/SuperChart';
@@ -51,6 +56,12 @@ function expectDimension(
);
}
const mount = (component: ReactElement) =>
enzymeMount(component, {
wrappingComponent: ThemeProvider,
wrappingComponentProps: { theme: supersetTheme },
});
describe('SuperChart', () => {
const plugins = [
new DiligentChartPlugin().configure({ key: ChartKeys.DILIGENT }),
@@ -303,6 +314,7 @@ describe('SuperChart', () => {
height="125"
/>,
);
// @ts-ignore
triggerResizeObserver([{ contentRect: { height: 125, width: 150 } }]);
return promiseTimeout(() => {
@@ -328,6 +340,7 @@ describe('SuperChart', () => {
height="25%"
/>,
);
// @ts-ignore
triggerResizeObserver([{ contentRect: { height: 75, width: 50 } }]);
return promiseTimeout(() => {