diff --git a/src/message/__tests__/message.test.jsx b/src/message/__tests__/message.test.jsx index c572f68335..d505eeb427 100644 --- a/src/message/__tests__/message.test.jsx +++ b/src/message/__tests__/message.test.jsx @@ -73,4 +73,33 @@ describe('Message Component test', () => { // t-icon expect(container.firstChild).not.toHaveClass('t-icon'); }); + + test(':style', () => { + const style = { backgroundColor: 'rgb(51, 51, 51)' } + THEME_LIST.forEach((t) => { + const { container } = render({defaultMessage}); + expect(container.firstChild).toHaveStyle(`background-color: ${style.backgroundColor};` ); + }); + }); + + test(':content as string, should get equal text', () => { + THEME_LIST.forEach((t) => { + const { container } = render(); + expect(container.firstChild).toHaveTextContent(defaultMessage); + }); + }); + + test(':content as ReactNode or as "() => ReactNode"', () => { + const ReactNode =

{defaultMessage}

+ const Fn =

{defaultMessage}

+ THEME_LIST.forEach((t) => { + const { container } = render(); + expect(container.querySelector('.wrapper')).not.toBe(null); + expect(container.querySelector('.wrapper')).toHaveTextContent(defaultMessage); + + const { container: containerByFn } = render(); + expect(containerByFn.querySelector('.wrapper')).not.toBe(null); + expect(containerByFn.querySelector('.wrapper')).toHaveTextContent(defaultMessage); + }); + }); });