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

chore: Run unit test with separate data. DO NOT MERGE #36592

Closed

Conversation

rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented Sep 27, 2024

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced comprehensive end-to-end tests for validating date column types in table widgets.
    • Added a new utility for generating formatted date strings for tomorrow.
    • Implemented a new enumeration for date input formats to enhance compatibility.
  • Bug Fixes

    • Improved date handling logic to ensure correct formatting and validation of various date inputs.
  • Tests

    • Added unit tests for data transformation functions, covering various scenarios including invalid date handling and empty data inputs.
    • Introduced mock data structures for comprehensive testing of date-related functionalities.

Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a suite of Cypress end-to-end tests for validating date column types in a table widget, alongside new utility functions and constants for date handling. It includes a new test file for date formats, a fixture for mock date data, and updates to existing components to improve date formatting and validation. The changes ensure robust handling of various date formats within the table widget, enhancing the overall functionality and reliability of date-related features.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_types_validation_spec.ts Added a test file for validating date column types in a table widget, covering various date formats and inline editing scenarios.
app/client/cypress/fixtures/tableDateColumnTypes.ts Introduced a fixture file exporting a constant that contains a JSON-like structure with various date representations for testing purposes.
app/client/cypress/support/Pages/Table.ts Added a public method to generate formatted date strings for tomorrow in both verbose and ISO formats.
app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx Introduced a utility function for converting input formats to Moment.js formats, and updated the date selection logic to use this utility.
app/client/src/widgets/TableWidgetV2/constants.ts Added a new enumeration defining constants for Moment.js date input formats.
app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/TransformDataPureFn.test.ts Created a test suite for the transformDataPureFn function, covering data transformation, invalid date handling, and empty data scenarios.
app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/fixtures.ts Introduced mock data structures for testing, including date-related and non-date data, along with expected output for transformation validation.
app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/transformDataPureFn.tsx Simplified the date validation logic by removing a specific type check for numbers.

Possibly related PRs

Suggested labels

Test, ok-to-test, Enhancement, Widgets Product, Table Widget V2, Needs Triaging

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007
  • jacquesikot

🎉 In the realm of dates, we now can play,
With formats and tests, come what may!
From Unix to ISO, all in a row,
Our table widget's ready to show!
So let’s celebrate this code parade,
For date validation, we’ve got it made! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rahulbarwal rahulbarwal changed the title Run unit test with separate data. chore: Run unit test with separate data. DO NOT MERGE Sep 27, 2024
@rahulbarwal rahulbarwal marked this pull request as ready for review September 27, 2024 14:35
@rahulbarwal rahulbarwal marked this pull request as draft September 27, 2024 14:36
@rahulbarwal rahulbarwal changed the base branch from fix/incorrect-selected-date-in-table-date-cell to release September 27, 2024 14:36
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Sep 27, 2024
@rahulbarwal rahulbarwal self-assigned this Sep 27, 2024
@rahulbarwal rahulbarwal marked this pull request as ready for review September 27, 2024 14:38
@rahulbarwal rahulbarwal deleted the fix/incorrect-selected-date-in-table-date-cell-rahul branch September 27, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants