Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

fix: the test parts set value to new Date() when there is no prop #347

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

oh3vci
Copy link
Contributor

@oh3vci oh3vci commented Sep 14, 2020

Description

I thought I fixed all of the new Date operator related DatePicker test issue. #340
However, there are some parts of set value to new Date when there is no prop.
So, I modified them.

Related Issues

#337

Tests

jest

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • Run yarn test or yarn test -u if you need to update snapshot.
  • Run yarn lint
  • I am willing to follow-up on review comments in a timely manner.

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #347 into master will decrease coverage by 0.16%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
- Coverage   83.44%   83.27%   -0.17%     
==========================================
  Files          37       37              
  Lines        1220     1220              
  Branches      369      369              
==========================================
- Hits         1018     1016       -2     
  Misses         88       88              
- Partials      114      116       +2     

@JeffGuKang
Copy link
Collaborator

I am not sure this PR can cover toLocaleString issue. It can be run differently on each OS locale without mocking.

@oh3vci
Copy link
Contributor Author

oh3vci commented Sep 14, 2020

I am not sure this PR can cover toLocaleString issue. It can be run differently on each OS locale without mocking.

What is the toLocaleString of /test/jestSetup.ts? I think it is for this situation.
Is it not worked? @hyochan

@oh3vci
Copy link
Contributor Author

oh3vci commented Sep 14, 2020

I thought it was necessary to add a locale prop to solve the locale problem.

@JeffGuKang
Copy link
Collaborator

JeffGuKang commented Sep 14, 2020

@oh3vci
There is some problems to mock Date on React Native environment. I guess it is related to Babel but not sure.
Anyway, it will be good to exclude snapshots from the Datepicker test.
hyochan/dooboo-ui#337 (comment)

Checking rendering and branches with props is enough without mocking Date.

@oh3vci
Copy link
Contributor Author

oh3vci commented Sep 15, 2020

I rebased it.

@JeffGuKang JeffGuKang merged commit 6f452bc into hyochan:master Sep 16, 2020
@oh3vci oh3vci deleted the test/datepicker branch September 17, 2020 07:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants