Skip to content

test(date): add test for dateToISO utility function #6308

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

Merged
merged 5 commits into from
Jan 20, 2023

Conversation

eriklharper
Copy link
Contributor

@eriklharper eriklharper commented Jan 19, 2023

Related Issue: #6289 (review)

Summary

Adds a spec test for dateToISO. Also updates the function to return a proper empty string value when any non-Date value is passed in.

@eriklharper eriklharper requested a review from a team as a code owner January 19, 2023 00:33
@github-actions github-actions bot added the testing Issues related to automated or manual testing. label Jan 19, 2023
@eriklharper eriklharper requested a review from benelan January 19, 2023 00:34
Copy link
Member

@benelan benelan 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 adding it! I added a comment about a potentially redundant test, but I'll leave it up to you

const date = new Date(2011, 10, 29);
const expectedValue = "2011-11-29";
expect(dateToISO(date)).toEqual(expectedValue);
});
Copy link
Member

Choose a reason for hiding this comment

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

I think this test is redundant since the one below tests the same base case plus the zero padding. We could probably remove it, what do you think?

@eriklharper eriklharper added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 20, 2023
@eriklharper eriklharper merged commit d816cde into master Jan 20, 2023
@eriklharper eriklharper deleted the eriklharper/dateToISO-spec-test branch January 20, 2023 22:35
@github-actions github-actions bot added this to the 2023 January Priorities milestone Jan 20, 2023
benelan added a commit that referenced this pull request Jan 22, 2023
…xpand

* origin/master:
  test(date): add test for dateToISO utility function (#6308)
benelan added a commit that referenced this pull request Jan 24, 2023
…negative-after-clear

* origin/master:
  build(deps): Bump gh-release from 6.0.4 to 7.0.1 (#6293)
  test(date): add test for dateToISO utility function (#6308)
  build: bump calcite-colors to latest (#6318)
  1.0.0-next.729
  fix(date-picker): end-range is now rounded and has the correct box-shadow (#6216)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr ready for visual snapshots Adding this label will run visual snapshot testing. testing Issues related to automated or manual testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants