-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-interactions: Fix using dates in expect statements #28413
Open
yann-combarnous
wants to merge
15
commits into
storybookjs:next-8.5
Choose a base branch
from
yann-combarnous:fix/interaction-call-date-param
base: next-8.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d8b9664
fix: Using dates in expect statements with the interactions add-on ca…
yann-combarnous ec0348e
chore: refactor
yann-combarnous fa49f1a
fix: catch invalid dates
yann-combarnous 16bfd9d
Merge branch 'next' into fix/interaction-call-date-param
yann-combarnous aa39329
refactor: decouple logic and display
yann-combarnous a6e65bd
Merge branch 'next' into fix/interaction-call-date-param
yann-combarnous 01b1d5c
define `generateStoryUIdFromRawStoryUid()`
5edc995
apply `generateStoryUIdFromRawStoryUid()`
96f8bb9
add a missing period
d65dcd0
Manager: Escape single quotes in dynamic import paths in wrapManagerE…
valentinpalkovic 2c40552
Merge pull request #30137 from storybookjs/valentin/escape-apostrophe…
valentinpalkovic b982c44
Merge pull request #30114 from msmx-mnakagawa/fix-angular-accent-char…
valentinpalkovic 529e939
Merge branch 'next' into fix/interaction-call-date-param
valentinpalkovic b266da8
Merge branch 'next-8.5' into fix/interaction-call-date-param
valentinpalkovic 7fbcbcb
Merge branch 'next-8.5' into fix/interaction-call-date-param
valentinpalkovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: refactor
- Loading branch information
commit ec0348e2e691379da55552e2ae39440622a5caec
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change assumes value can always be converted to a valid Date. However, if value is an invalid date string, new Date(value) will result in an invalid Date object (Invalid Date).
It can lead to runtime errors if value is not a valid date string. Consider adding error handling for invalid dates.
Suggestion: To handle potential invalid date values, add error handling and validate the date conversion.
Something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @jadehamel , updated PR with catch for invalid date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good suggestion. I think we can even make do without the try/catch by omitting the
getTime
call. I left a review with my take on it.