Skip to content

fix: initial store value fix for query response tab test case#36487

Merged
albinAppsmith merged 1 commit intoreleasefrom
fix/query-response-test
Sep 23, 2024
Merged

fix: initial store value fix for query response tab test case#36487
albinAppsmith merged 1 commit intoreleasefrom
fix/query-response-test

Conversation

@albinAppsmith
Copy link
Contributor

@albinAppsmith albinAppsmith commented Sep 23, 2024

Description

Initial state value was not having module instance data which cause test failure in EE. This PR address this issue.

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="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10997712576
Commit: 8877729
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Mon, 23 Sep 2024 16:17:41 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Tests
    • Updated the test setup for the Query Response Tab to simplify the store data initialization using a factory function.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes in this pull request involve updating the test file QueryResponseTab.test.tsx by replacing a previously defined mock store configuration with a factory function, getIDETestState. This new approach simplifies the test setup by generating store data dynamically, allowing for a cleaner and more maintainable code structure while retaining the overall test functionality.

Changes

File Change Summary
app/client/src/pages/Editor/QueryEditor/QueryResponseTab.test.tsx Replaced mock store data structure with a factory function getIDETestState to simplify test setup.

Possibly related PRs

Suggested labels

Test, IDE Product, IDE Pod, ok-to-test

Suggested reviewers

  • AmanAgarwal041
  • hetunandu
  • sagar-qa007

Poem

In the realm of code, a change so bright,
A factory's birth, simplifying the fight.
Mock stores now fade, as tests take their flight,
Clean and concise, they shine with delight!
To the editors, we raise a cheer,
For better tests, we hold so dear! 🎉


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 12986df and 8877729.

Files selected for processing (1)
  • app/client/src/pages/Editor/QueryEditor/QueryResponseTab.test.tsx (2 hunks)
Additional comments not posted (3)
app/client/src/pages/Editor/QueryEditor/QueryResponseTab.test.tsx (3)

11-11: Good job importing the test factory function!

Class, let's take a moment to appreciate this new import statement. By using getIDETestState from our test utilities, we're moving towards a more organized and consistent way of setting up our test environment. This is like having a well-prepared lesson plan – it makes everything run more smoothly!


34-34: Let's ensure our tests are still in good shape!

Class, we've made changes to our test setup, which is like rearranging our classroom. Now, we need to make sure all our learning stations (tests) still work properly with this new arrangement.

Please run all the tests in this file and report back on the results. If any tests fail, we may need to update them to match our new setup. Here's a script to help us check:

#!/bin/bash
# Description: Run the tests and check for any failures

# Test: Run the tests for this file
npm test -- app/client/src/pages/Editor/QueryEditor/QueryResponseTab.test.tsx

# Test: Check for any TODOs or FIXMEs that might have been added
rg -i 'TODO|FIXME' app/client/src/pages/Editor/QueryEditor/QueryResponseTab.test.tsx

34-34: Excellent simplification of our test setup!

Students, observe how we've streamlined our mock store configuration. This is like tidying up our classroom – it makes our work easier and more efficient. However, let's make sure we haven't accidentally put away something important.

Let's double-check that our new setup includes all the necessary data for our tests. Run this script to inspect the contents of our test state:


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.

@github-actions github-actions bot added the Bug Something isn't working label Sep 23, 2024
@albinAppsmith albinAppsmith added the ok-to-test Required label for CI label Sep 23, 2024
@albinAppsmith albinAppsmith merged commit 4a70072 into release Sep 23, 2024
@albinAppsmith albinAppsmith deleted the fix/query-response-test branch September 23, 2024 16:51
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…thorg#36487)

## Description
 
Initial state value was not having module instance data which cause test
failure in EE. This PR address this issue.

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="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10997712576>
> Commit: 8877729
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10997712576&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Mon, 23 Sep 2024 16:17:41 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Tests**
- Updated the test setup for the Query Response Tab to simplify the
store data initialization using a factory function.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants