mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
test: fix test case (#52224)
Some checks failed
Publish Any Commit / build (push) Has been cancelled
🔀 Sync mirror to Gitee / mirror (push) Has been cancelled
✅ test / lint (push) Has been cancelled
✅ test / test-react-legacy (16, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (16, 2/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 2/2) (push) Has been cancelled
✅ test / test-node (push) Has been cancelled
✅ test / test-react-latest (dom, 1/2) (push) Has been cancelled
✅ test / test-react-latest (dom, 2/2) (push) Has been cancelled
✅ test / build (push) Has been cancelled
✅ test / test lib/es module (es, 1/2) (push) Has been cancelled
✅ test / test lib/es module (es, 2/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 1/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 2/2) (push) Has been cancelled
👁️ Visual Regression Persist Start / test image (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Has been cancelled
✅ test / test-coverage (push) Has been cancelled
Some checks failed
Publish Any Commit / build (push) Has been cancelled
🔀 Sync mirror to Gitee / mirror (push) Has been cancelled
✅ test / lint (push) Has been cancelled
✅ test / test-react-legacy (16, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (16, 2/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 2/2) (push) Has been cancelled
✅ test / test-node (push) Has been cancelled
✅ test / test-react-latest (dom, 1/2) (push) Has been cancelled
✅ test / test-react-latest (dom, 2/2) (push) Has been cancelled
✅ test / build (push) Has been cancelled
✅ test / test lib/es module (es, 1/2) (push) Has been cancelled
✅ test / test lib/es module (es, 2/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 1/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 2/2) (push) Has been cancelled
👁️ Visual Regression Persist Start / test image (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Has been cancelled
✅ test / test-coverage (push) Has been cancelled
* test: fix test case * test: ignore image diff
This commit is contained in:
parent
9fcce8ffdc
commit
6139162214
@ -54,7 +54,7 @@ const App: React.FC = () => {
|
||||
<Flex vertical gap="small">
|
||||
{/* link color */}
|
||||
<Flex gap="small">
|
||||
<ConfigProvider theme={{ token: { colorPrimary: 'red' } }}>
|
||||
<ConfigProvider theme={{ token: { colorLink: '#FF0000' } }}>
|
||||
<Button type="link">Link Button</Button>
|
||||
</ConfigProvider>
|
||||
<Button type="link">Link Button</Button>
|
||||
|
@ -84,7 +84,7 @@
|
||||
"test": "jest --config .jest.js --no-cache",
|
||||
"test:all": "sh -e ./scripts/test-all.sh",
|
||||
"test:dekko": "tsx ./tests/dekko/index.test.ts",
|
||||
"test:image": "jest --config .jest.image.js --no-cache -i -u --forceExit",
|
||||
"test:image": "cross-env MOCK_USE_ID=false jest --config .jest.image.js --no-cache -i -u --forceExit",
|
||||
"test:node": "npm run version && jest --config .jest.node.js --no-cache",
|
||||
"test:package-diff": "antd-tools run package-diff",
|
||||
"test:site": "jest --config .jest.site.js",
|
||||
|
@ -76,7 +76,19 @@ if (typeof MessageChannel === 'undefined') {
|
||||
}
|
||||
|
||||
// Mock useId to return a stable id for snapshot testing
|
||||
jest.mock('react', () => ({
|
||||
...jest.requireActual('react'),
|
||||
useId: () => 'test-id',
|
||||
}));
|
||||
jest.mock('react', () => {
|
||||
const originReact = jest.requireActual('react');
|
||||
|
||||
let cloneReact = {
|
||||
...originReact,
|
||||
};
|
||||
|
||||
if (process.env.MOCK_USE_ID !== 'false') {
|
||||
cloneReact = {
|
||||
...cloneReact,
|
||||
useId: () => 'test-id',
|
||||
};
|
||||
}
|
||||
|
||||
return cloneReact;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user