sadpandajoe commented on code in PR #35828:
URL: https://github.com/apache/superset/pull/35828#discussion_r2462077806
##########
cypress/e2e/dashboards/export-special-chars.cy.js:
##########
@@ -0,0 +1,175 @@
+// cypress/e2e/dashboards/export-special-chars.cy.js
+// Superset Issue #31158 - E2E Test for Dashboard Export with Special
Characters
+
+describe("Dashboard Export API - Issue #31158", () => {
+ beforeEach(() => {
+ // We test the API directly without UI since we're in headless environment
+ // In a real Superset instance, these would interact with the UI
+ cy.session("admin", () => {
+ cy.visit("http://localhost:8088/login/");
+ cy.get('input[id="username"]').type("admin");
+ cy.get('input[id="password"]').type("admin");
+ cy.get("button[type='submit']").click();
+ cy.url().should("include", "/dashboard/list");
+ });
+ });
+
+ it("should properly encode dashboard export filename with special
characters", () => {
+ // Test the export API endpoint directly
+ // This verifies the fix for issue #31158
+
+ // Test Case 1: Normal dashboard name (baseline)
+ cy.request({
+ method: "GET",
+ url: "http://localhost:8088/api/v1/dashboard/export",
+ headers: {
+ Authorization: "Bearer admin",
+ },
+ }).then((response) => {
+ expect(response.status).to.eq(200);
+ expect(response.headers["content-type"]).to.include("application/zip");
+
+ // Verify Content-Disposition header is present
+ const contentDisposition = response.headers["content-disposition"];
+ expect(contentDisposition).to.exist;
+ expect(contentDisposition).to.include("attachment");
+ expect(contentDisposition).to.include("filename=");
+
+ cy.log("✅ Normal export works");
Review Comment:
not much value in logging for e2e tests like this as by the time you get
here, it should already pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]