diff --git a/packages/semi-ui/typography/__test__/typography.test.js b/packages/semi-ui/typography/__test__/typography.test.js index 20cb52a73f..ab288b809d 100644 --- a/packages/semi-ui/typography/__test__/typography.test.js +++ b/packages/semi-ui/typography/__test__/typography.test.js @@ -107,4 +107,21 @@ describe(`Typography`, () => { }) expect(numeral.find('.price').text()).toEqual('1992.15') }) + + it('children is template string', () => { + const { Text } = Typography; + const code = 'code'; + + const typographyParagraph = mount( + + Key: {code} + + ); + expect(typographyParagraph.find('.semi-typography').children().at(0).text()).toEqual('Key: code'); + }); + }); diff --git a/packages/semi-ui/typography/base.tsx b/packages/semi-ui/typography/base.tsx index 908d82b635..3698acf857 100644 --- a/packages/semi-ui/typography/base.tsx +++ b/packages/semi-ui/typography/base.tsx @@ -391,11 +391,14 @@ export default class Base extends Component