Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ describe(
});

it("5. Verify Api binding", () => {
apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users");
apiPage.CreateAndFillApi(
"http://host.docker.internal:5001/v1/dynamicrecords/getrecordsArray",
);
apiPage.RunAPI();
EditorNavigation.SelectEntityByName(
"TreeSelect1",
Expand All @@ -181,7 +183,7 @@ describe(
propPane.MoveToTab("Content");
propPane.UpdatePropertyFieldValue(
"Options",
`{{Api1.data.users.map((s)=>{return{"label":s.name,"value":s.name}})}}`,
`{{JSON.parse(Api1.data).map((item) => {return {"label":item.value, "value":item.abbr};})}}`,
);
agHelper.GetNClick(
`${locators._widgetInDeployed("singleselecttreewidget")}`,
Expand Down Expand Up @@ -308,7 +310,7 @@ describe(
propPane.ToggleJSMode("onOptionChange", true);
propPane.UpdatePropertyFieldValue(
"onOptionChange",
`{{download('http://host.docker.internal:4200/kiwi.svg', 'kiwi.svg', 'image/svg+xml').then(() => {
`{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.svg', 'image/svg+xml').then(() => {
showAlert('Download Success', '');
});}}`,
);
Comment on lines +313 to 316
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Now, let's turn our attention to the onOptionChange function, specifically the download part.

I notice you've changed the download URL to a JPEG image. That's fine, but your success message still talks about an SVG file. Remember, consistency is key in coding! Let's make sure our messages accurately reflect what we're doing.

Also, I'd like you to think about error handling here. What happens if the download fails? It's always good to plan for different scenarios!

Let's update the success message to match the file type:

-        `{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.svg', 'image/svg+xml').then(() => {
+        `{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.jpeg', 'image/jpeg').then(() => {
            showAlert('Download Success', '');
          });}}`,

This change ensures our message matches the actual file being downloaded.

📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.svg', 'image/svg+xml').then(() => {
showAlert('Download Success', '');
});}}`,
);
`{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.jpeg', 'image/jpeg').then(() => {
showAlert('Download Success', '');
});}}`,
);

Expand Down