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

Add Tests for ChipWithIcon Component issue #39 #53

Closed
wants to merge 1 commit into from
Closed

Add Tests for ChipWithIcon Component issue #39 #53

wants to merge 1 commit into from

Conversation

aliamerj
Copy link

This pull request introduces comprehensive tests for the ChipWithIcon component to ensure it renders correctly under various conditions. The new tests verify that the component behaves as expected when different icons and text transformation properties are applied.

Key highlights include:

  • Testing the rendering of multiple Material-UI icons within the component.
  • Validating the text transformation logic based on the transformText prop.
  • Ensuring the component maintains its structure and functionality with varied props.

Resolves #39

ChipWithIconComponentWithTransformText.test = async (browser, { component }) => {
browser.expect(component).to.be.visible;
browser.expect.element('[data-testid="chip-icon"]').to.be.present;
browser.expect(component).text.to.equal('sample chip');
Copy link
Member

@vaibhavsingh97 vaibhavsingh97 Mar 12, 2024

Choose a reason for hiding this comment

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

transformText converts sample chip to Sample chip

Copy link
Author

@aliamerj aliamerj Mar 12, 2024

Choose a reason for hiding this comment

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

do i need to add other test with "sample chip" and expect "Sample chip" ??

Copy link
Author

Choose a reason for hiding this comment

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

or just change the values and keep it two tests ??

Copy link
Author

@aliamerj aliamerj Mar 12, 2024

Choose a reason for hiding this comment

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

@vaibhavsingh97
when enable the transformText it did not convert sample chip to Sample chip
as you can see
image
with test
image

image

I don't get it

  • it works fine in the app
  • in the test it dose the opposite

I think this happens because the inner component <Text> ,maybe

so what do you think ?

@aliamerj aliamerj closed this by deleting the head repository May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add component tests
2 participants