diff --git a/packages/design/src/config-provider/__tests__/theme.test.tsx b/packages/design/src/config-provider/__tests__/theme.test.tsx index 021cb6b1f..8450c2988 100644 --- a/packages/design/src/config-provider/__tests__/theme.test.tsx +++ b/packages/design/src/config-provider/__tests__/theme.test.tsx @@ -1,8 +1,10 @@ import React, { useContext } from 'react'; import { render } from '@testing-library/react'; -import { ConfigProvider, useToken } from '@oceanbase/design'; +import { ConfigProvider, useToken, theme } from '@oceanbase/design'; import defaultTheme from '../../theme/default'; +const antToken = theme.getDesignToken(); + describe('ConfigProvider theme', () => { it('ConfigProvider theme token', () => { const Child1 = () => { @@ -38,4 +40,37 @@ describe('ConfigProvider theme', () => { ); }); + + it('ConfigProvider theme.customFont', () => { + const Child1 = () => { + const { token } = useToken(); + expect(token.fontFamily).toBe(antToken.fontFamily); + return
; + }; + const Child2 = () => { + const { token } = useToken(); + expect(token.fontFamily).toBe(`'Source Sans Pro', ${antToken.fontFamily}`); + return ; + }; + const Child3 = () => { + const { token } = useToken(); + expect(token.fontFamily).toBe(`'Source Sans Pro', ${antToken.fontFamily}`); + return ; + }; + render( +