dnbexperience / eufemia

DNB Design System
https://eufemia.dnb.no
Other
53 stars 32 forks source link

chore: reduces unnecessary logs in Field.Date tests #4272

Closed langz closed 1 week ago

langz commented 1 week ago

I don't think this PR fixes anything, but rather highlights some kind of type mismatch or casting gone wrong in Field.Date component, as it comes a lot of string values with value "undefined" and "null" to the function.

It aims to fix all the console.logs when running yarn test packages/dnb-eufemia/src/extensions/forms/Field/Date/__tests__/Date.test.tsx in main branch:

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: undefined

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: null

      at log (src/shared/helpers.js:407:15)

  console.log
    Eufemia convertStringToDate got invalid date: 2023-12-0

      at console.<anonymous> (../../node_modules/jest-mock/build/index.js:794:25)

  console.log
    Eufemia convertStringToDate got invalid date: 2023-12-0
vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 8:30pm
langz commented 1 week ago

@joakbjerk will take a look at this 🙇

codesandbox-ci[bot] commented 1 week ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

joakbjerk commented 1 week ago

@joakbjerk will take a look at this 🙇

Can do @langz 🔎

tujoworker commented 1 week ago

To me it looks good now.

tujoworker commented 4 days ago

:tada: This PR is included in version 10.56.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: