Skip to content

Commit 1fd8deb

Browse files
committed
chore: add tests
1 parent d9aaa47 commit 1fd8deb

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

components/_util/static-style-extract/__tests__/__snapshots__/index.test.js.snap

Lines changed: 0 additions & 5 deletions
This file was deleted.

components/_util/static-style-extract/__tests__/index.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// import { StyleProvider } from '../../cssinjs';
22
import { extractStyle } from '../index';
3-
// import { ConfigProvider } from '../../../components';
3+
import { ConfigProvider } from '../../../components';
44

55
const testGreenColor = '#008000';
66
describe('Static-Style-Extract', () => {
@@ -9,23 +9,23 @@ describe('Static-Style-Extract', () => {
99
expect(cssText).not.toContain(testGreenColor);
1010
expect(cssText).toMatchSnapshot();
1111
});
12-
// it('should extract static styles with customTheme', () => {
13-
// const cssText = extractStyle((node) => {
14-
// return(
15-
// <ConfigProvider
16-
// theme={{
17-
// token: {
18-
// colorPrimary: testGreenColor,
19-
// },
20-
// }}
21-
// >
22-
// {node}
23-
// </ConfigProvider>
24-
// );
25-
// });
26-
// expect(cssText).toContain(testGreenColor);
27-
// expect(cssText).toMatchSnapshot();
28-
// });
12+
it('should extract static styles with customTheme', () => {
13+
const cssText = extractStyle(node => {
14+
return (
15+
<ConfigProvider
16+
theme={{
17+
token: {
18+
colorPrimary: testGreenColor,
19+
},
20+
}}
21+
>
22+
{node}
23+
</ConfigProvider>
24+
);
25+
});
26+
expect(cssText).toContain(testGreenColor);
27+
expect(cssText).toMatchSnapshot();
28+
});
2929
// it('with custom hashPriority', () => {
3030
// const cssText = extractStyle(
3131
// (node) => (

0 commit comments

Comments
 (0)