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
feat: Added unit test for query/js delete - next item selection #31915
Conversation
WalkthroughWalkthroughThis update introduces enhancements to the delete functionality for JavaScript and queries within the application. The key changes involve making the Changes
Assessment against linked issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@@ -111,7 +111,7 @@ interface RedirectActionDescription { | |||
payload?: EntityItem; | |||
} | |||
|
|||
function getNextEntityAfterDelete( | |||
export function getNextEntityAfterDelete( |
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.
Consider adding comprehensive documentation for the getNextEntityAfterDelete
function. While the code is clear, detailed comments explaining the function's purpose, parameters, and return values would enhance maintainability and readability for future developers.
+ /**
+ * Determines the next entity to focus on after an entity is deleted.
+ *
+ * @param {string} deletedId The ID of the deleted entity.
+ * @param {EntityItem[]} allItems A list of all entities.
+ * @return {RedirectActionDescription} An object describing the redirect action to take.
+ */
export function getNextEntityAfterDelete(
deletedId: string,
allItems: EntityItem[],
): RedirectActionDescription {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export function getNextEntityAfterDelete( | |
/** | |
* Determines the next entity to focus on after an entity is deleted. | |
* | |
* @param {string} deletedId The ID of the deleted entity. | |
* @param {EntityItem[]} allItems A list of all entities. | |
* @return {RedirectActionDescription} An object describing the redirect action to take. | |
*/ | |
export function getNextEntityAfterDelete( | |
deletedId: string, | |
allItems: EntityItem[], | |
): RedirectActionDescription { |
Description
This PR added unit test to validate getNextEntityAfterDelete
Fixes #31864
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Important
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8340217451
Commit:
81950b382c97f2634a44d9f64eef904104df8390
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉
Summary by CodeRabbit