-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored src/components/AddOn/support/components/Action/Action.test…
….tsx from Jest to Vitest (#2482) * Migrated to vitest * Added ts-doc comment --------- Co-authored-by: Vamshi Maskuri <[email protected]>
- Loading branch information
1 parent
9b5bd3e
commit c2630ae
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/components/AddOn/support/components/Action/Action.spec.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,31 @@ | ||
/** | ||
* Unit tests for the Action component. | ||
* | ||
* This file contains tests for the Action component to ensure it behaves as expected | ||
* under various scenarios. | ||
*/ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { Provider } from 'react-redux'; | ||
import { describe, test, expect } from 'vitest'; | ||
|
||
import { store } from 'state/store'; | ||
import Action from './Action'; | ||
|
||
describe('Testing Action Component', () => { | ||
const props = { | ||
children: 'dummy children', | ||
label: 'dummy label', | ||
}; | ||
|
||
test('should render props and text elements for the page component', () => { | ||
const { getByText } = render( | ||
<Provider store={store}> | ||
<Action {...props} /> | ||
</Provider>, | ||
); | ||
|
||
expect(getByText(props.label)).toBeInTheDocument(); | ||
expect(getByText(props.children)).toBeInTheDocument(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@testing-library/jest-dom'; |