From 38235a07ec748d7b667d810331287432e787e781 Mon Sep 17 00:00:00 2001 From: Werner Punz Date: Fri, 6 Dec 2024 17:13:36 +0100 Subject: [PATCH] https://issues.apache.org/jira/browse/MYFACES-4699: Fix for responseCode type --- api/src/client/package-lock.json | 14 +++++++------- api/src/client/package.json | 2 +- .../typescript/faces/@types/definitions/index.d.ts | 2 +- .../typescript/faces/impl/xhrCore/ErrorData.ts | 2 +- .../typescript/faces/impl/xhrCore/EventData.ts | 4 ++-- .../faces/test/xhrCore/RequestTest_23.spec.ts | 1 + 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/api/src/client/package-lock.json b/api/src/client/package-lock.json index 7d2596bad8..8dab58db3c 100644 --- a/api/src/client/package-lock.json +++ b/api/src/client/package-lock.json @@ -22,7 +22,7 @@ "html-webpack-plugin": "^5.5.1", "jsdom": "^21.1.1", "jsdom-global": "^3.0.2", - "jsf.js_next_gen": "4.0.4-beta.4", + "jsf.js_next_gen": "4.0.4-beta.5", "mocha": "^10.2.0", "npm-check-updates": "^16.10.8", "nyc": "^15.1.0", @@ -5174,9 +5174,9 @@ } }, "node_modules/jsf.js_next_gen": { - "version": "4.0.4-beta.4", - "resolved": "https://registry.npmjs.org/jsf.js_next_gen/-/jsf.js_next_gen-4.0.4-beta.4.tgz", - "integrity": "sha512-7Ey3/eSesFl9DLbyTBPzKWz8QjUJ7BGSE+mommstWfcE0WHOqADFXprOM8lTamYf7xkOQEVMF87Qx3qwI1038w==", + "version": "4.0.4-beta.5", + "resolved": "https://registry.npmjs.org/jsf.js_next_gen/-/jsf.js_next_gen-4.0.4-beta.5.tgz", + "integrity": "sha512-jvs9qjSmJoAALH5JpLH2L4JgofXt506B8wXpYiPZfGhVFSdPegjxkbyMp2WTnwYHO/WcU4RmcANqlsH3Kl9HvA==", "dev": true, "dependencies": { "mona-dish": "0.28.12" @@ -14191,9 +14191,9 @@ "dev": true }, "jsf.js_next_gen": { - "version": "4.0.4-beta.4", - "resolved": "https://registry.npmjs.org/jsf.js_next_gen/-/jsf.js_next_gen-4.0.4-beta.4.tgz", - "integrity": "sha512-7Ey3/eSesFl9DLbyTBPzKWz8QjUJ7BGSE+mommstWfcE0WHOqADFXprOM8lTamYf7xkOQEVMF87Qx3qwI1038w==", + "version": "4.0.4-beta.5", + "resolved": "https://registry.npmjs.org/jsf.js_next_gen/-/jsf.js_next_gen-4.0.4-beta.5.tgz", + "integrity": "sha512-jvs9qjSmJoAALH5JpLH2L4JgofXt506B8wXpYiPZfGhVFSdPegjxkbyMp2WTnwYHO/WcU4RmcANqlsH3Kl9HvA==", "dev": true, "requires": { "mona-dish": "0.28.12" diff --git a/api/src/client/package.json b/api/src/client/package.json index 4605a2e70e..d866e1982d 100644 --- a/api/src/client/package.json +++ b/api/src/client/package.json @@ -24,7 +24,7 @@ "html-webpack-plugin": "^5.5.1", "jsdom": "^21.1.1", "jsdom-global": "^3.0.2", - "jsf.js_next_gen": "4.0.4-beta.4", + "jsf.js_next_gen": "4.0.4-beta.5", "mocha": "^10.2.0", "npm-check-updates": "^16.10.8", "nyc": "^15.1.0", diff --git a/api/src/client/typescript/faces/@types/definitions/index.d.ts b/api/src/client/typescript/faces/@types/definitions/index.d.ts index 7792c8d894..e895f88461 100644 --- a/api/src/client/typescript/faces/@types/definitions/index.d.ts +++ b/api/src/client/typescript/faces/@types/definitions/index.d.ts @@ -62,7 +62,7 @@ declare global { serverErrorName: string; serverErrorMessage: string; source: any; - responseCode: string; + responseCode: number; responseText: string; responseXML: string; } diff --git a/api/src/client/typescript/faces/impl/xhrCore/ErrorData.ts b/api/src/client/typescript/faces/impl/xhrCore/ErrorData.ts index f107842ebc..7a4e136d86 100644 --- a/api/src/client/typescript/faces/impl/xhrCore/ErrorData.ts +++ b/api/src/client/typescript/faces/impl/xhrCore/ErrorData.ts @@ -75,7 +75,7 @@ export class ErrorData extends EventData implements IErrorData { //tck requires that the type is prefixed to the message itself (jsdoc also) in case of a server error this.errorMessage = errorMessage; - this.responseCode = `${responseCode}`; + this.responseCode = responseCode; this.responseText = responseText; this.responseXML = responseXML; diff --git a/api/src/client/typescript/faces/impl/xhrCore/EventData.ts b/api/src/client/typescript/faces/impl/xhrCore/EventData.ts index a04f0ebb6e..05ade0ecf2 100644 --- a/api/src/client/typescript/faces/impl/xhrCore/EventData.ts +++ b/api/src/client/typescript/faces/impl/xhrCore/EventData.ts @@ -20,7 +20,7 @@ export class EventData implements IEventData{ type: string; status: string; source: any; - responseCode: string; + responseCode: number; responseText: string; responseXML: Document; @@ -40,7 +40,7 @@ export class EventData implements IEventData{ } if (name !== BEGIN) { - eventData.responseCode = request?.status?.toString(); + eventData.responseCode = request?.status; eventData.responseText = request?.responseText; eventData.responseXML = request?.responseXML; } diff --git a/api/src/client/typescript/faces/test/xhrCore/RequestTest_23.spec.ts b/api/src/client/typescript/faces/test/xhrCore/RequestTest_23.spec.ts index e4fa5cdeff..d35af65aeb 100644 --- a/api/src/client/typescript/faces/test/xhrCore/RequestTest_23.spec.ts +++ b/api/src/client/typescript/faces/test/xhrCore/RequestTest_23.spec.ts @@ -338,6 +338,7 @@ describe('Tests after core when it hits response', function () { expect(!!error.errorMessage).to.eq(true); expect(!!error.source).to.eq(true); expect(!!error.responseCode).to.eq(true); + expect(typeof error.responseCode).to.eq("number"); expect(!!error.responseText).to.eq(true); expect(!error.responseXML).to.eq(true); done();