Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEQ]Yaswanth/FEQ-1974_Added test cases for sidenote component #137

Conversation

yaswanth-deriv
Copy link
Contributor

Added test cases for side note component in deriv-com/ui library

Comment on lines 21 to 29
it("renders children and title correctly", () => {
const { getByText } = render(
<SideNote title="Title">
<div>Child content</div>
</SideNote>
);
expect(getByText("Title")).toBeInTheDocument();
expect(getByText("Child content")).toBeInTheDocument();
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certain variables such as title is being repeated and I suggest to define them in a beforeEach and reuse them in different tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't use it in the beforeEach method because I've been using queryByText, getByText, and queryByTestId for specific cases.

@shayan-deriv shayan-deriv merged commit dda8d11 into deriv-com:main Mar 26, 2024
1 check passed
Copy link

🎉 This PR is included in version 1.12.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yaswanth-deriv yaswanth-deriv deleted the yaswanth/FEQ-1974_Added_test_for_sidenote_component branch April 1, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants