-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test]:(base/Home) update step items test units
- Loading branch information
Showing
9 changed files
with
342 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/base/src/page/Home/DefaultScene/components/StepItems/__tests__/index.ce.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @test_version ce | ||
*/ | ||
import { fireEvent, screen } from '@testing-library/react'; | ||
import { AdminUserDevopsSteps } from '../index.data'; | ||
import { superRender } from '../../../../../../testUtils/customRender'; | ||
import StepItems from '..'; | ||
|
||
describe('test base/Home/StepItems', () => { | ||
it('should match snapshot', () => { | ||
const projectID = '1'; | ||
const navigateSpy = jest.fn(); | ||
const setOpenRulePageProjectSelectorModalSpy = jest.fn(); | ||
const steps_admin = AdminUserDevopsSteps({ | ||
navigate: navigateSpy, | ||
projectID, | ||
setOpenRulePageProjectSelectorModal: | ||
setOpenRulePageProjectSelectorModalSpy | ||
}); | ||
superRender(<StepItems steps={steps_admin} />); | ||
|
||
fireEvent.click(screen.getByText('发起导出工单')); | ||
expect(navigateSpy).toBeCalledTimes(1); | ||
expect(navigateSpy).toBeCalledWith(`project/${projectID}/data/export`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.