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

test: replace toMatchInlineSnapshot with meaningful assertions #728

Merged
merged 10 commits into from
Aug 15, 2021

Conversation

adibfirman
Copy link
Contributor

@adibfirman adibfirman commented Aug 14, 2021

Closes #697

Description

Basically, assertion toMatchInlineSnapshot have an unnecessary snapshot to each PR's (according to the issue) so we just to remove that and replace it with something meaningful assertions

Current Tasks

Replacing toMatchInlineSnapshot to these files.
(*) it means that the assertion it's simple and not necessary to remove it.

  • ~/components/tests/report-button.test.tsx
  • ~/components/tests/search-filter.test.tsx
  • ~/components/tests/search-form.test.tsx
  • ~/components/home/tests/homepage-contributing.test.tsx
  • ~/components/home/tests/homepage-header.test.tsx
  • ~/components/home/tests/homepage-start.test.tsx
  • ~/components/home/tests/homepage-telemedicine-cta.test.tsx
  • ~/components/home/tests/homepage-whatsapp-cta.test.tsx
  • ~/components/kontak-darurat/tests/chatbot-section.test.tsx
  • ~/components/layout/tests/global-header.test.tsx
  • ~/components/layout/tests/navigation.test.tsx
  • ~/components/ui/tests/alert.test.tsx
  • ~/components/ui/tests/badge.test.tsx*
  • ~/components/ui/tests/button.test.tsx*
  • ~/components/ui/tests/feedback-section.test.tsx
  • ~/components/ui/tests/responsive-img.test.tsx
  • ~/components/ui/forms/tests/input-text.test.tsx*
  • ~/components/ui/forms/tests/input-textarea.test.tsx*

@netlify
Copy link

netlify bot commented Aug 14, 2021

✔️ Deploy Preview for wargabantuwarga ready!

🔨 Explore the source changes: 96360d6

🔍 Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/6119a074ade2c000077cc766

😎 Browse the preview: https://deploy-preview-728--wargabantuwarga.netlify.app

@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #728 (96360d6) into main (5f307a8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #728   +/-   ##
=======================================
  Coverage   84.18%   84.18%           
=======================================
  Files         128      128           
  Lines        1404     1404           
  Branches      464      464           
=======================================
  Hits         1182     1182           
  Misses        215      215           
  Partials        7        7           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f307a8...96360d6. Read the comment docs.

@adibfirman adibfirman changed the title test: replace toMatchInlineSnapshot on component/report-button test test: replace toMatchInlineSnapshot with meaningful assertions Aug 14, 2021
@adibfirman adibfirman marked this pull request as ready for review August 14, 2021 14:51
Copy link
Member

@zainfathoni zainfathoni left a comment

Choose a reason for hiding this comment

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

Thanks for working on it, @adibfirman. 🙏
I have some change requests, though. 😁

components/__tests__/report-button.test.tsx Outdated Show resolved Hide resolved
components/__tests__/search-filter.test.tsx Outdated Show resolved Hide resolved
components/__tests__/search-form.test.tsx Outdated Show resolved Hide resolved
components/home/__tests__/homepage-contributing.test.tsx Outdated Show resolved Hide resolved
components/home/__tests__/homepage-header.test.tsx Outdated Show resolved Hide resolved
components/ui/__tests__/button.test.tsx Outdated Show resolved Hide resolved
components/ui/__tests__/button.test.tsx Outdated Show resolved Hide resolved
components/ui/__tests__/button.test.tsx Outdated Show resolved Hide resolved
components/ui/forms/__tests__/input-text.test.tsx Outdated Show resolved Hide resolved
components/ui/forms/__tests__/input-textarea.test.tsx Outdated Show resolved Hide resolved
@rubiagatra
Copy link
Collaborator

rubiagatra commented Aug 15, 2021

@adibfirman could you create a task list like on the issue? so we can track all the changes

  • ~/components/__tests__/report-button.test.tsx
  • ~/components/__tests__/search-filter.test.tsx
  • ~/components/__tests__/search-form.test.tsx
  • ~/components/home/__tests__/homepage-contributing.test.tsx
  • ~/components/home/__tests__/homepage-header.test.tsx
  • ~/components/home/__tests__/homepage-start.test.tsx
  • ~/components/home/__tests__/homepage-telemedicine-cta.test.tsx
  • ~/components/home/__tests__/homepage-whatsapp-cta.test.tsx
  • ~/components/kontak-darurat/__tests__/chatbot-section.test.tsx
  • ~/components/layout/__tests__/global-header.test.tsx
  • ~/components/layout/__tests__/navigation.test.tsx
  • ~/components/ui/__tests__/alert.test.tsx
  • ~/components/ui/__tests__/badge.test.tsx
  • ~/components/ui/__tests__/button.test.tsx
  • ~/components/ui/__tests__/feedback-section.test.tsx
  • ~/components/ui/__tests__/responsive-img.test.tsx
  • ~/components/ui/forms/__tests__/input-text.test.tsx
  • ~/components/ui/forms/__tests__/input-textarea.test.tsx

@adibfirman
Copy link
Contributor Author

@rubiagatra updated mas 👌

Copy link
Member

@zainfathoni zainfathoni left a comment

Choose a reason for hiding this comment

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

I have a few more minor changes. 😁 🙏

components/layout/__tests__/navigation.test.tsx Outdated Show resolved Hide resolved
@zainfathoni zainfathoni mentioned this pull request Aug 15, 2021
4 tasks
@zainfathoni zainfathoni added the automerge To be merged automatically once all the requirements are fulfilled label Aug 15, 2021
@zainfathoni zainfathoni enabled auto-merge (squash) August 15, 2021 23:17
Copy link
Member

@zainfathoni zainfathoni left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Thanks for working on it, @adibfirman! 🙏
You've unblocked some stale issues & PRs, including #722. 🚀

@zainfathoni zainfathoni merged commit 5f77b21 into kawalcovid19:main Aug 15, 2021
@adibfirman adibfirman deleted the adibfirman/697 branch August 16, 2021 00:12
@zainfathoni
Copy link
Member

@all-contributors please add @adibfirman for test

@allcontributors
Copy link
Contributor

@zainfathoni

I've put up a pull request to add @adibfirman! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge To be merged automatically once all the requirements are fulfilled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid extensive usages of .toMatchInlineSnapshot() in tests to make it more useful
3 participants