mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
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:
committed by
GitHub
parent
35b8a72dae
commit
a8a48af7fa
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user