Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

added unit tests for OcAutocomplete component #1440

Merged
merged 1 commit into from
Jul 5, 2021

Conversation

kiranparajuli589
Copy link
Contributor

@kiranparajuli589 kiranparajuli589 commented Jun 30, 2021

Description

added unit test for OcAutocomplete component

  • only covered message part
  • dropdown test will be added after UiKit removal

Related Issue

Motivation and Context

How Has This Been Tested?

  • 🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added/updated

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Jun 30, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kiranparajuli589 kiranparajuli589 force-pushed the unitest-oc-autocomplete branch from f43af46 to c64cee8 Compare June 30, 2021 07:21
@kiranparajuli589 kiranparajuli589 changed the title [wip] added unit tests for OcAutocomplete component added unit tests for OcAutocomplete component Jun 30, 2021
@kiranparajuli589 kiranparajuli589 marked this pull request as ready for review June 30, 2021 08:00
@kiranparajuli589 kiranparajuli589 requested review from individual-it and saw-jan and removed request for LukasHirt June 30, 2021 08:01
@kiranparajuli589 kiranparajuli589 self-assigned this Jun 30, 2021
const descriptionMessageElement = wrapper.find(selectors.message)
expect(descriptionMessageElement.exists()).toBeTruthy()
expect(descriptionMessageElement.isVisible()).toBeTruthy()
expect(descriptionMessageElement.get("span").text()).toBe("Help Text")
Copy link
Member

Choose a reason for hiding this comment

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

can we do without the span? to not depend on that implementation detail?

Suggested change
expect(descriptionMessageElement.get("span").text()).toBe("Help Text")
expect(descriptionMessageElement.text()).toBe("Help Text")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to assert text, we can actually.
but for class we've to get the span el

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@individual-it individual-it merged commit 49017ca into master Jul 5, 2021
@delete-merged-branch delete-merged-branch bot deleted the unitest-oc-autocomplete branch July 5, 2021 04:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants