mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
chore: fix emotion style missing in visual diff (#50995)
This commit is contained in:
parent
8537f73e3d
commit
fa4028beb7
@ -2,6 +2,7 @@ import path from 'path';
|
||||
import React from 'react';
|
||||
// Reference: https://github.com/ant-design/ant-design/pull/24003#discussion_r427267386
|
||||
import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';
|
||||
import { extractStaticStyle } from 'antd-style';
|
||||
import dayjs from 'dayjs';
|
||||
import fse from 'fs-extra';
|
||||
import { globSync } from 'glob';
|
||||
@ -153,14 +154,13 @@ export default function imageTest(
|
||||
|
||||
if (options.ssr) {
|
||||
html = ReactDOMServer.renderToString(element);
|
||||
styleStr = extractStyle(cache);
|
||||
styleStr = extractStyle(cache) + extractStaticStyle(html).map((item) => item.tag);
|
||||
} else {
|
||||
const { unmount } = render(element, {
|
||||
container,
|
||||
});
|
||||
html = container.innerHTML;
|
||||
styleStr = extractStyle(cache);
|
||||
|
||||
styleStr = extractStyle(cache) + extractStaticStyle(html).map((item) => item.tag);
|
||||
// We should extract style before unmount
|
||||
unmount();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user