PromucFlow_constructor/app/client/cypress/integration/Regression_TestSuite/ClientSideTests
ashit-rath 27fe4d74e2
fix: List v2 child widgets event defined with action selector (#22418)
## Description

TL;DR
For list widget's child widget, when events like `onClick` were defined
using the action selector, it throws syntax error.

Reason:
Underneath the hood the new action selector by default applies a
semi-colon (`;`) at the end of every action selected. This does not play
well with the List v2 as the widget adds a wrapper on top of this action
which leads to a syntax error.

Fix:
 For trigger paths the binding is ow enclosed with `{ }`
 where as the binding paths are not enclosed with `{ }`

 Example
```js
 (() => { showAlert("Hello") })() // For trigger paths
 (() => currentItem.name )() // For binding paths
```

It is expected for binding paths to return a value from the binding so
to make it return by default js binding cannot be wrapped around `{ }`.

In case of trigger paths, it is not expected for the js binding to
return anything but only execute other actions. When wrapped around `{
}`, it gives an advantage when action selectors are used to define a
trigger/event. Action selectors by default adds a semi-colon(;) at the
end of every action. If the wrapper `{}` is not present then a binding
```
  (() => showAlert("Hello"); )()

```
would throw an error as the addition of a semi-colon is an invalid
JavaScript syntax.
  Hence we convert the above IIFE to 
```
(() => { showAlert("Hello"); } )()
```
 to make the semi-colon work.

Fixes #22373

## Type of change
- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [x] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [x] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: Rimil Dey <rimil@appsmith.com>
2023-04-17 11:52:01 +05:30
..
ActionExecution feat: Action selector (#21582) 2023-04-06 22:19:12 +05:30
AdminSettings chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
AppNavigation fix: Combine app navigation tests where possible to reduce Cypress cloud costs (#21868) 2023-03-29 18:37:07 +05:30
AuditLogs chore: Add cypress.env.json to gitIgnore (#21413) 2023-03-16 10:14:32 +05:30
Autocomplete feat: show lint errors in async functions bound to sync fields (#21187) 2023-04-03 16:11:15 +05:30
Binding feat: Action selector (#21582) 2023-04-06 22:19:12 +05:30
Branding chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
BugTests fix: Error navigation blockers (#22291) 2023-04-12 22:38:55 +05:30
CodeComment chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
DynamicHeight feat: Action selector (#21582) 2023-04-06 22:19:12 +05:30
EmbedSettings feat: Improved App Navigation (#19312) 2023-03-23 17:11:58 +05:30
ExplorerTests fix: Do not set widget ancestry if selection happens via canvas (#22069) 2023-04-10 12:55:14 +05:30
FormNativeToRawTests chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
Git fix: [Git] Avoid 404 when checking out a branch (#21894) 2023-04-04 10:29:00 +05:30
Github chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
Google chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
IDE fix: Maintain focus on editor when Escape is pressed with autocomplete menu open (#22164) 2023-04-14 12:11:47 +05:30
JSLibrary fix: JSPDF output API crash (#20544) 2023-02-10 13:13:22 +05:30
JSObject feat: JSObject variable as a state (JSObject variable mutation) (#19926) 2023-04-07 13:11:36 +05:30
Linting test: Cypress - Flaky fix (#22263) 2023-04-12 00:34:32 +05:30
MobileResponsiveTests test: Tests for auto conversion and mobile viewport (#21931) 2023-04-14 17:03:50 +05:30
Onboarding feat: Error Navigation (#21753) 2023-04-10 18:29:14 +05:30
OtherUIFeatures feat: Error Navigation (#21753) 2023-04-10 18:29:14 +05:30
PeekOverlay chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
PropertyPane test: Cypress - Updating to TED Random api (#21615) 2023-03-22 01:22:39 +05:30
Refactoring test: Cypress - Automated basic tests for MsSQL DS (#21446) 2023-03-16 23:58:32 +05:30
SettingsPane test: Flaky test fix (#21120) 2023-03-05 08:52:42 +05:30
Templates chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
ThemingTests feat: self host google fonts (#22129) 2023-04-13 18:48:37 +05:30
VisualTests feat: Auto indent and save code on pressing Ctrl/Cmd + S (#22176) 2023-04-16 18:21:32 +05:30
Widgets fix: List v2 child widgets event defined with action selector (#22418) 2023-04-17 11:52:01 +05:30
Workspace fix: Adding a permission check for creating new datasource on generate page (#22085) 2023-04-05 17:22:43 +05:30