Skip to content

Comments

test: add test for request card component#994

Merged
iamitprakash merged 2 commits intodevelopfrom
test/request-card
May 14, 2025
Merged

test: add test for request card component#994
iamitprakash merged 2 commits intodevelopfrom
test/request-card

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented May 9, 2025

Date: 09 May 2025

Developer Name: @AnujChhikara


Issue Ticket Number

Description

  • This PR adds tests for the Request Card component.
  • It covers rendering of the UI and verifies the functionality for approving and rejecting requests.

🔧 Note: Tests are currently skipped as the related feature code has not yet been pushed.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1

image
image

Additional Notes

@AnujChhikara AnujChhikara self-assigned this May 9, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 9, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • Tests
    • Added new (skipped) test cases to verify the display and removal of extension request cards and request cards in dev mode, including checks for approve/reject actions and correct field rendering.
  • Chores
    • Updated mock data to include a reason field for pending requests.

Walkthrough

Three new skipped test cases were added to the extension requests test suite, and a new skipped test suite with three tests was added for request cards in dev mode. The mock data for pending requests was updated to include a "reason" field in the first entry. No existing tests or logic were modified.

Changes

File(s) Change Summary
tests/extension-requests/extension-requests.test.js Added three skipped Puppeteer UI tests for extension request cards: field display, approve-removal, and reject-removal.
tests/requests/requests.test.js Added a skipped test suite "Request Card (Dev Mode Enabled)" with three UI tests for card display and approve/reject actions.
mock-data/requests/index.js Added a reason property to the first object in the pendingRequest mock data array.

Sequence Diagram(s)

sequenceDiagram
    participant Tester
    participant UI
    participant MockData

    Tester->>UI: Navigate to filtered requests page (dev mode)
    UI->>MockData: Fetch pending requests with reasons
    MockData-->>UI: Return mock request data
    UI-->>Tester: Display request/extension request cards

    Tester->>UI: Click approve or reject button
    UI->>UI: Remove card from display
    UI-->>Tester: Updated UI reflects removal
Loading

Possibly related PRs

Suggested reviewers

  • iamitprakash
  • MayankBansal12

Poem

A hop and a skip, new tests in the queue,
Cards for requests—approve or adieu!
With reasons now shown and buttons to press,
The dashboard grows stronger, less prone to a mess.
🐇 Here's to the code, so tidy and neat,
Each test a small carrot—so sweet!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 958860d and 48dff13.

📒 Files selected for processing (3)
  • __tests__/extension-requests/extension-requests.test.js (1 hunks)
  • __tests__/requests/requests.test.js (1 hunks)
  • mock-data/requests/index.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
__tests__/extension-requests/extension-requests.test.js (4)
mock-data/constants.js (1)
  • LOCAL_TEST_PAGE_URL (2-2)
mock-data/extension-requests/index.js (1)
  • extensionRequestsListPending (97-147)
extension-requests/script.js (3)
  • taskTitle (642-646)
  • approveButton (905-909)
  • approveButton (971-974)
mock-data/tasks/index.js (1)
  • taskDone (1-25)
__tests__/requests/requests.test.js (5)
mock-data/constants.js (1)
  • LOCAL_TEST_PAGE_URL (2-2)
requests/script.js (1)
  • card (253-263)
extension-requests/script.js (2)
  • approveButton (905-909)
  • approveButton (971-974)
profile-diff-details/script.js (1)
  • rejectButton (202-207)
mock-data/requests/index.js (1)
  • pendingRequest (1-20)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
mock-data/requests/index.js (1)

11-11: Addition of necessary mock data field

The reason property has been added to the pendingRequest mock data object, which will be used in the new test cases to verify proper rendering of this field in the request cards.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 9, 2025

Deploying dashboard-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 357ba4b
Status: ✅  Deploy successful!
Preview URL: https://25c70d16.dashboard-rds.pages.dev
Branch Preview URL: https://test-request-card.dashboard-rds.pages.dev

View logs

RishiChaubey31
RishiChaubey31 previously approved these changes May 9, 2025
@AnujChhikara AnujChhikara force-pushed the test/request-card branch 2 times, most recently from 4649f05 to d6cd0bb Compare May 9, 2025 16:05
pankajjs
pankajjs previously approved these changes May 9, 2025
Copy link
Contributor

@pankajjs pankajjs left a comment

Choose a reason for hiding this comment

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

All my suggestions have been addressed.
LGTM

RishiChaubey31
RishiChaubey31 previously approved these changes May 9, 2025
@iamitprakash iamitprakash merged commit 4ebcf97 into develop May 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants