jsf.js_next_gen 4.0.1-beta.5 → 4.0.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/window/faces-development.js +92 -63
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +92 -63
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +1 -1
- package/src/main/typescript/impl/util/XhrQueueController.ts +3 -17
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +95 -52
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +40 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +7 -0
- package/src/main/typescript/test/myfaces/{OnLoadSpec.ts → OnLoad.spec.ts} +2 -2
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +113 -0
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +9 -12
- package/target/impl/util/XhrQueueController.js +3 -18
- package/target/impl/util/XhrQueueController.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +89 -45
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +39 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +4 -0
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/myfaces/OnLoad.spec.js +57 -0
- package/target/test/myfaces/OnLoad.spec.js.map +1 -0
- package/target/test/myfaces/OnLoadSpec.js +2 -2
- package/target/test/myfaces/OnLoadSpec.js.map +1 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +135 -0
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +8 -5
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
|
@@ -130,8 +130,10 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
|
|
|
130
130
|
this.sendRequest(formData);
|
|
131
131
|
}
|
|
132
132
|
catch (e) {
|
|
133
|
-
//
|
|
134
|
-
|
|
133
|
+
// this happens usually in a client side condition, hence we have to deal in with it in a client
|
|
134
|
+
// side manner
|
|
135
|
+
this.handleErrorAndClearQueue(e);
|
|
136
|
+
throw e;
|
|
135
137
|
}
|
|
136
138
|
return this;
|
|
137
139
|
}
|
|
@@ -155,102 +157,138 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
|
|
|
155
157
|
registerXhrCallbacks(resolve, reject) {
|
|
156
158
|
const xhrObject = this.xhrObject;
|
|
157
159
|
xhrObject.onabort = () => {
|
|
158
|
-
this.onAbort(reject);
|
|
160
|
+
this.onAbort(resolve, reject);
|
|
159
161
|
};
|
|
160
162
|
xhrObject.ontimeout = () => {
|
|
161
|
-
this.onTimeout(reject);
|
|
163
|
+
this.onTimeout(resolve, reject);
|
|
162
164
|
};
|
|
163
165
|
xhrObject.onload = () => {
|
|
164
|
-
this.
|
|
166
|
+
this.onResponseReceived(resolve);
|
|
165
167
|
};
|
|
166
168
|
xhrObject.onloadend = () => {
|
|
167
|
-
this.
|
|
169
|
+
this.onResponseProcessed(this.xhrObject, resolve);
|
|
168
170
|
};
|
|
169
171
|
xhrObject.onerror = (errorData) => {
|
|
170
|
-
//
|
|
171
|
-
// cancel is called from outside
|
|
172
|
+
// Safari in rare cases triggers an error when cancelling a request internally, or when
|
|
172
173
|
// in this case we simply ignore the request and clear up the queue, because
|
|
173
174
|
// it is not safe anymore to proceed with the current queue
|
|
174
175
|
// This bypasses a Safari issue where it keeps requests hanging after page unload
|
|
175
176
|
// and then triggers a cancel error on then instead of just stopping
|
|
176
177
|
// and clearing the code
|
|
178
|
+
// in a page unload case it is safe to clear the queue
|
|
179
|
+
// in the exact safari case any request after this one in the queue is invalid
|
|
180
|
+
// because the queue references xhr requests to a page which already is gone!
|
|
177
181
|
if (this.isCancelledResponse(this.xhrObject)) {
|
|
178
182
|
/*
|
|
179
183
|
* this triggers the catch chain and after that finally
|
|
180
184
|
*/
|
|
181
|
-
reject();
|
|
182
185
|
this.stopProgress = true;
|
|
186
|
+
reject();
|
|
183
187
|
return;
|
|
184
188
|
}
|
|
185
|
-
|
|
189
|
+
// error already processed somewhere else
|
|
190
|
+
if (this.stopProgress) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.handleError(errorData);
|
|
186
194
|
};
|
|
187
195
|
}
|
|
188
196
|
isCancelledResponse(currentTarget) {
|
|
189
|
-
return (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.status) === 0 && // cancelled by browser
|
|
197
|
+
return (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.status) === 0 && // cancelled internally by browser
|
|
190
198
|
(currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.readyState) === 4 &&
|
|
191
199
|
(currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseText) === '' &&
|
|
192
200
|
(currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseXML) === null;
|
|
193
201
|
}
|
|
194
202
|
/*
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
* xhr processing callbacks
|
|
204
|
+
*
|
|
205
|
+
* Those methods are the callbacks called by
|
|
206
|
+
* the xhr object depending on its own state
|
|
207
|
+
*/
|
|
208
|
+
/**
|
|
209
|
+
* client side abort... also here for now we clean the queue
|
|
210
|
+
*
|
|
211
|
+
* @param resolve
|
|
212
|
+
* @param reject
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
215
|
+
onAbort(resolve, reject) {
|
|
216
|
+
// reject means clear queue, in this case we abort entirely the processing
|
|
217
|
+
// does not happen yet, we have to probably rethink this strategy in the future
|
|
218
|
+
// when we introduce cancel functionality
|
|
219
|
+
this.handleGenericError(reject);
|
|
202
220
|
}
|
|
203
|
-
|
|
221
|
+
/**
|
|
222
|
+
* request timeout, this must be handled like a generic server error per spec
|
|
223
|
+
* unfortunately, so we have to jump to the next item (we cancelled before)
|
|
224
|
+
* @param resolve
|
|
225
|
+
* @param reject
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
onTimeout(resolve, reject) {
|
|
229
|
+
// timeout also means we we probably should clear the queue,
|
|
230
|
+
// the state is unsafe for the next requests
|
|
204
231
|
this.sendEvent(Const_1.STATE_EVT_TIMEOUT);
|
|
205
|
-
|
|
232
|
+
this.handleGenericError(resolve);
|
|
206
233
|
}
|
|
207
|
-
|
|
208
|
-
|
|
234
|
+
/**
|
|
235
|
+
* the response is received and normally is a normal response
|
|
236
|
+
* but also can be some kind of error (http code >= 300)
|
|
237
|
+
* In any case the response will be resolved either as error or response
|
|
238
|
+
* and the next item in the queue will be processed
|
|
239
|
+
* @param resolve
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
onResponseReceived(resolve) {
|
|
243
|
+
var _a, _b, _c, _d;
|
|
209
244
|
this.sendEvent(Const_1.COMPLETE);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
245
|
+
/*
|
|
246
|
+
* second on error path
|
|
247
|
+
*/
|
|
248
|
+
if (((_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 0) >= 300 || !((_c = this === null || this === void 0 ? void 0 : this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML)) {
|
|
249
|
+
// all errors from the server are resolved without interfering in the queue
|
|
250
|
+
this.handleGenericError(resolve);
|
|
214
251
|
return;
|
|
215
252
|
}
|
|
216
|
-
(0, Const_1.$faces)().ajax.response(this.xhrObject, (
|
|
253
|
+
(0, Const_1.$faces)().ajax.response(this.xhrObject, (_d = this.responseContext.value) !== null && _d !== void 0 ? _d : {});
|
|
217
254
|
}
|
|
218
|
-
|
|
219
|
-
var _a;
|
|
255
|
+
handleGenericError(resolveOrReject) {
|
|
256
|
+
var _a, _b, _c, _d;
|
|
220
257
|
this.stopProgress = true;
|
|
221
258
|
const errorData = {
|
|
222
259
|
type: Const_1.ERROR,
|
|
223
260
|
status: Const_1.MALFORMEDXML,
|
|
224
|
-
responseCode:
|
|
225
|
-
responseText: (
|
|
261
|
+
responseCode: (_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 400,
|
|
262
|
+
responseText: (_d = (_c = this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseText) !== null && _d !== void 0 ? _d : "Error",
|
|
226
263
|
source: this.internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID).value
|
|
227
264
|
};
|
|
228
265
|
try {
|
|
229
266
|
this.handleError(errorData, true);
|
|
230
267
|
}
|
|
231
268
|
finally {
|
|
232
|
-
// we issue a
|
|
269
|
+
// we issue a resolveOrReject in this case to allow the system to recover
|
|
233
270
|
// reject would clean up the queue
|
|
234
|
-
resolve
|
|
271
|
+
// resolve would trigger the next element in the queue to be processed
|
|
272
|
+
resolveOrReject(errorData);
|
|
235
273
|
}
|
|
236
274
|
// non blocking non clearing
|
|
237
275
|
}
|
|
238
|
-
|
|
239
|
-
|
|
276
|
+
/**
|
|
277
|
+
* last minute cleanup, the request now either is fully done
|
|
278
|
+
* or not by having had a cancel or error event be
|
|
279
|
+
* @param data
|
|
280
|
+
* @param resolve
|
|
281
|
+
* @private
|
|
282
|
+
*/
|
|
283
|
+
onResponseProcessed(data, resolve) {
|
|
284
|
+
// if stop progress true, the cleanup already has been performed
|
|
240
285
|
if (this.stopProgress) {
|
|
241
286
|
return;
|
|
242
287
|
}
|
|
243
|
-
/**
|
|
244
|
-
* now call the then chain
|
|
245
|
-
*/
|
|
246
|
-
resolve(data);
|
|
247
|
-
}
|
|
248
|
-
onError(errorData, reject) {
|
|
249
|
-
this.handleError(errorData);
|
|
250
288
|
/*
|
|
251
|
-
*
|
|
289
|
+
* normal case, cleanup == next item if possible
|
|
252
290
|
*/
|
|
253
|
-
|
|
291
|
+
resolve(data);
|
|
254
292
|
}
|
|
255
293
|
sendRequest(formData) {
|
|
256
294
|
const isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
|
|
@@ -279,10 +317,16 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
|
|
|
279
317
|
}
|
|
280
318
|
catch (e) {
|
|
281
319
|
e.source = (_a = e === null || e === void 0 ? void 0 : e.source) !== null && _a !== void 0 ? _a : this.requestContext.getIf(Const_1.SOURCE).value;
|
|
282
|
-
this
|
|
320
|
+
// this is a client error, no save state anymore for queue processing!
|
|
321
|
+
this.handleErrorAndClearQueue(e);
|
|
322
|
+
// we forward the error upward like all client side errors
|
|
283
323
|
throw e;
|
|
284
324
|
}
|
|
285
325
|
}
|
|
326
|
+
handleErrorAndClearQueue(e, responseFormatError = false) {
|
|
327
|
+
this.handleError(e, responseFormatError);
|
|
328
|
+
this.reject(e);
|
|
329
|
+
}
|
|
286
330
|
handleError(exception, responseFormatError = false) {
|
|
287
331
|
const errorData = (responseFormatError) ? ErrorData_1.ErrorData.fromHttpConnection(exception.source, exception.type, exception.status, exception.responseText, exception.responseCode, exception.status) : ErrorData_1.ErrorData.fromClient(exception);
|
|
288
332
|
const eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XhrRequest.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/xhrCore/XhrRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yDAAoE;AACpE,yCAAqC;AACrC,0CAA2C;AAE3C,+CAA0C;AAC1C,2CAAsC;AACtC,2CAAsC;AACtC,uCAAqC;AACrC,yCAoBuB;AACvB,+DAI+B;AAC/B,IAAO,eAAe,GAAG,cAAO,CAAC,eAAe,CAAC;AAGjD;;;;;;;;;;;;;GAaG;AAEH,MAAa,UAAW,SAAQ,6BAA6B;
|
|
1
|
+
{"version":3,"file":"XhrRequest.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/xhrCore/XhrRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yDAAoE;AACpE,yCAAqC;AACrC,0CAA2C;AAE3C,+CAA0C;AAC1C,2CAAsC;AACtC,2CAAsC;AACtC,uCAAqC;AACrC,yCAoBuB;AACvB,+DAI+B;AAC/B,IAAO,eAAe,GAAG,cAAO,CAAC,eAAe,CAAC;AAGjD;;;;;;;;;;;;;GAaG;AAEH,MAAa,UAAW,SAAQ,6BAA6B;IASzD;;;;;;;;;OASG;IACH,YACY,cAAyB,EACzB,eAAuB,EACvB,UAAU,kBAAU,EACpB,WAAW,qBAAa,EACxB,cAAc,mBAAW;QAEjC,KAAK,EAAE,CAAC;QANA,mBAAc,GAAd,cAAc,CAAW;QACzB,oBAAe,GAAf,eAAe,CAAQ;QACvB,YAAO,GAAP,OAAO,CAAa;QACpB,aAAQ,GAAR,QAAQ,CAAgB;QACxB,gBAAW,GAAX,WAAW,CAAc;QApB7B,iBAAY,GAAG,KAAK,CAAC;QAGrB,cAAS,GAAG,IAAI,cAAc,EAAE,CAAC;QAoBrC,2EAA2E;QAC3E,yEAAyE;QACzE,gEAAgE;QAChE,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CA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AAE,MAAM,mCAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,cAAM,CAAC,CAAC,KAAK,CAAC;YAChE,sEAAsE;YACtE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;YACjC,0DAA0D;YAC1D,MAAM,CAAC,CAAC;SACX;IACL,CAAC;IAEO,wBAAwB,CAAC,CAAC,EAAE,sBAA+B,KAAK;QACpE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAEO,WAAW,CAAC,SAAS,EAAE,sBAA+B,KAAK;QAC/D,MAAM,SAAS,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,qBAAS,CAAC,kBAAkB,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,qBAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/N,MAAM,YAAY,GAAG,IAAA,wCAAkB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAQ,CAAC,CAAC;QAE7F,yBAAc,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;CACJ;AA5UD,gCA4UC"}
|
|
@@ -242,6 +242,41 @@ var StandardInits;
|
|
|
242
242
|
|
|
243
243
|
`;
|
|
244
244
|
}
|
|
245
|
+
StandardInits.ERROR_CHAIN_PAGE = `
|
|
246
|
+
<!DOCTYPE html>
|
|
247
|
+
<html lang="en">
|
|
248
|
+
<head>
|
|
249
|
+
<meta charset="UTF-8">
|
|
250
|
+
<title>Title</title>
|
|
251
|
+
</head>
|
|
252
|
+
<body>
|
|
253
|
+
<h2>Error Chain Testcase</h2>
|
|
254
|
+
<script type="text/javascript">
|
|
255
|
+
/**
|
|
256
|
+
* code identical to mojarra test, both stem from me
|
|
257
|
+
* so mojarras side EPL here ASL2!
|
|
258
|
+
*
|
|
259
|
+
* @param event
|
|
260
|
+
*/
|
|
261
|
+
function triggerRequestChain(event) {
|
|
262
|
+
for(let cnt = 0; cnt < 5; cnt++) {
|
|
263
|
+
faces.ajax.request(event.target, "click", {
|
|
264
|
+
render:"form1",
|
|
265
|
+
onerror: function() {
|
|
266
|
+
document.getElementById("errorCalled").innerHTML = "1";
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
</script>
|
|
272
|
+
<div id="errorCalled"></div>
|
|
273
|
+
<form id="form1">
|
|
274
|
+
<div id="form1:out1">0</div>
|
|
275
|
+
<input type="button" id="form1:button1" onclick="triggerRequestChain(event)">
|
|
276
|
+
</form>
|
|
277
|
+
</body>
|
|
278
|
+
</html>
|
|
279
|
+
`;
|
|
245
280
|
/**
|
|
246
281
|
* This is a standardized small page mockup
|
|
247
282
|
* testing the various aspects of the protocol
|
|
@@ -416,6 +451,10 @@ var StandardInits;
|
|
|
416
451
|
return init((IS_40) ? StandardInits.PROTOCOL_PAGE : StandardInits.PROTOCOL_PAGE.replace(/jakarta/gi, "javax"), withJsf, IS_40);
|
|
417
452
|
}
|
|
418
453
|
StandardInits.protocolPage = protocolPage;
|
|
454
|
+
function errorChainPage(withJsf = true, IS_40 = true) {
|
|
455
|
+
return init((IS_40) ? StandardInits.ERROR_CHAIN_PAGE : StandardInits.ERROR_CHAIN_PAGE.replace(/jakarta/gi, "javax"), withJsf, IS_40);
|
|
456
|
+
}
|
|
457
|
+
StandardInits.errorChainPage = errorChainPage;
|
|
419
458
|
function prefixEmbeddedPage(withJsf = true, IS_40 = true) {
|
|
420
459
|
return init((IS_40) ? HTML_FORM_PREFIXED_EMBEDDED : HTML_FORM_PREFIXED_EMBEDDED.replace(/jakarta/gi, "javax"), withJsf, IS_40);
|
|
421
460
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInits.js","sourceRoot":"","sources":["../../../../../src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,yCAAmC;AAQnC;;;;;;;;;;;;GAYG;AACH,IAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"StandardInits.js","sourceRoot":"","sources":["../../../../../src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,yCAAmC;AAQnC;;;;;;;;;;;;GAYG;AACH,IAAc,aAAa,CAyhB1B;AAzhBD,WAAc,aAAa;IAEV,0BAAY,GAAG;;;;;;;;;;;;QAYxB,CAAC;IAGQ,yBAAW,GAAG;;;;;;;;;;;;;;;;QAgBvB,CAAC;IAEL;;OAEG;IACH,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;QActB,CAAC;IAIL;;OAEG;IACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;QAcvB,CAAC;IAGL;;OAEG;IACH,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4B1B,CAAC;IAEL;;OAEG;IACU,uCAAyB,GAAG;;;;;;;;;QASrC,CAAC;IAEL,MAAM,2BAA2B,GAAG;;;;;;;MAOlC,cAAA,yBAAyB;;QAEvB,CAAC;IAGL,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;QAazB,CAAC;IAIL;;OAEG;IACH,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;QAc3B,CAAC;IAIQ,qBAAO,GAAG,uOAAuO,CAAC;IAE/P;;;;OAIG;IACH,SAAS,2BAA2B,CAAC,aAAqB,EAAE,KAAK,GAAC,IAAI;QAClE,OAAO;;;;;;8B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AC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;gBACrD,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;aAC5B;iBAAM;gBACH,aAAa;gBACb,MAAM,kDAAO,cAAc,IAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;;oBACxC,KAAK,GAAG,MAAA,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,KAAK,CAAC,0CAAG,QAAQ,CAAC,CAAC;gBAClD,CAAC,CAAC,CAAC;aACN;YACD,sDAAsD;YACtD,0CAA0C;YAC1C,OAAO,KAAK,CAAC;QAEjB,CAAC;KAAA;AACL,CAAC,EAzhBa,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAyhB1B"}
|
|
@@ -237,4 +237,8 @@ XmlResponses.NONCE_REPLY = `
|
|
|
237
237
|
</update></changes></partial-response>
|
|
238
238
|
`;
|
|
239
239
|
XmlResponses.ILLEGAL_RESP = `>>>> xxxx >YYYY-!->>>`;
|
|
240
|
+
XmlResponses.ERROR_CHAIN_RESPOND_OK = (cnt) => {
|
|
241
|
+
return `<partial-response><changes><update id='form1:out1'><![CDATA[<div id="form1:out1">${cnt}</div>]]>
|
|
242
|
+
</update></changes></partial-response>`;
|
|
243
|
+
};
|
|
240
244
|
//# sourceMappingURL=XmlResponses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XmlResponses.js","sourceRoot":"","sources":["../../../../../src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;;AAAzB,
|
|
1
|
+
{"version":3,"file":"XmlResponses.js","sourceRoot":"","sources":["../../../../../src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;;AAAzB,oCAmQC;AAjQU,mBAAM,GAAG;;;;;;;;KAQf,CAAC;AAEK,4BAAe,GAAG;;;;;;;;;;;;;;KAcxB,CAAC;AAEK,8BAAiB,GAAC;;;;KAIxB,CAAC;AAEK,4BAAe,GAAG;;;;;;;;;;;;;;KAcxB,CAAC;AAEK,qBAAQ,GAAG;;;;;;KAMjB,CAAC;AAEK,wBAAW,GAAG;;;;;;KAMpB,CAAC;AAEK,6BAAgB,GAAG;;;;;;;;;;KAUzB,CAAC;AAEK,oBAAO,GAAG;;;;;;KAMhB,CAAC;AACK,oBAAO,GAAG;;;;;;;KAOhB,CAAC;AAEK,6BAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB7B,CAAC;AAES,6BAAgB,GAAG;;;;;;;;;;;;;;CAc7B,CAAC;AAES,kCAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiClC,CAAC;AAES,qCAAwB,GAAG;;;;;;;;CAQrC,CAAC;AACS,uCAA0B,GAAG;;;;;;;;;CASvC,CAAA;AAEU,+CAAkC,GAAG;;;;;;;;;;;;CAY/C,CAAA;AAEU,yBAAY,GAAG;;;;;;;;;;;;;;CAczB,CAAA;AAEU,0BAAa,GAAG;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAA;AAGU,wBAAW,GAAG;;;;KAIpB,CAAC;AAEK,yBAAY,GAAG,uBAAuB,CAAC;AAGtC,mCAAsB,GAAG,CAAC,GAAW,EAAU,EAAE;IACrD,OAAO,oFAAoF,GAAG;2CAC3D,CAAC;AACxC,CAAC,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const mocha_1 = require("mocha");
|
|
28
|
+
const chai_1 = require("chai");
|
|
29
|
+
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
30
|
+
var defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
|
|
31
|
+
/**
|
|
32
|
+
* Adds test s for the newly introduced onload handling
|
|
33
|
+
*/
|
|
34
|
+
(0, mocha_1.describe)('Tests on the xhr core when it starts to call the request', function () {
|
|
35
|
+
beforeEach(() => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return;
|
|
37
|
+
}));
|
|
38
|
+
(0, mocha_1.it)("must be present", function () {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
yield defaultMyFaces();
|
|
41
|
+
(0, chai_1.expect)(myfaces === null || myfaces === void 0 ? void 0 : myfaces.onDomReady).to.exist;
|
|
42
|
+
return true;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
(0, mocha_1.it)("must be called on onDocumentReady", function (done) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
let called = false;
|
|
48
|
+
const onDomCalled = () => {
|
|
49
|
+
(0, chai_1.expect)(true).to.true;
|
|
50
|
+
done();
|
|
51
|
+
};
|
|
52
|
+
myfaces === null || myfaces === void 0 ? void 0 : myfaces.onDomReady(onDomCalled);
|
|
53
|
+
yield defaultMyFaces();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=OnLoad.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnLoad.spec.js","sourceRoot":"","sources":["../../../src/main/typescript/test/myfaces/OnLoad.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;AAEH,iCAAmC;AAEnC,+BAA4B;AAC5B,8EAAyE;AACzE,IAAO,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC;AAMrD;;GAEG;AACH,IAAA,gBAAQ,EAAC,0DAA0D,EAAE;IAEjE,UAAU,CAAC,GAAS,EAAE;QAClB,OAAM;IACV,CAAC,CAAA,CAAC,CAAC;IAEH,IAAA,UAAE,EAAC,iBAAiB,EAAE;;YAClB,MAAM,cAAc,EAAE,CAAC;YACvB,IAAA,aAAM,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YACrC,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA,CAAC,CAAC;IAEH,IAAA,UAAE,EAAC,mCAAmC,EAAE,UAAe,IAAI;;YACvD,IAAI,MAAM,GAAY,KAAK,CAAC;YAC5B,MAAM,WAAW,GAAG,GAAG,EAAE;gBACrB,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;gBACrB,IAAI,EAAE,CAAC;YACX,CAAC,CAAA;YACD,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC,WAAW,CAAC,CAAC;YACjC,MAAM,cAAc,EAAE,CAAC;QAC3B,CAAC;KAAA,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -35,11 +35,11 @@ var defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
|
|
|
35
35
|
beforeEach(() => __awaiter(this, void 0, void 0, function* () {
|
|
36
36
|
return;
|
|
37
37
|
}));
|
|
38
|
-
(0, mocha_1.it)("must be present", function (
|
|
38
|
+
(0, mocha_1.it)("must be present", function () {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
yield defaultMyFaces();
|
|
41
41
|
(0, chai_1.expect)(myfaces === null || myfaces === void 0 ? void 0 : myfaces.onDomReady).to.exist;
|
|
42
|
-
|
|
42
|
+
return true;
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
(0, mocha_1.it)("must be called on onDocumentReady", function (done) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnLoadSpec.js","sourceRoot":"","sources":["../../../src/main/typescript/test/myfaces/OnLoadSpec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;AAEH,iCAAmC;AAEnC,+BAA4B;AAC5B,8EAAyE;AACzE,IAAO,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC;AAMrD;;GAEG;AACH,IAAA,gBAAQ,EAAC,0DAA0D,EAAE;IAEjE,UAAU,CAAC,GAAS,EAAE;QAClB,OAAM;IACV,CAAC,CAAA,CAAC,CAAC;IAEH,IAAA,UAAE,EAAC,iBAAiB,EAAE
|
|
1
|
+
{"version":3,"file":"OnLoadSpec.js","sourceRoot":"","sources":["../../../src/main/typescript/test/myfaces/OnLoadSpec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;AAEH,iCAAmC;AAEnC,+BAA4B;AAC5B,8EAAyE;AACzE,IAAO,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC;AAMrD;;GAEG;AACH,IAAA,gBAAQ,EAAC,0DAA0D,EAAE;IAEjE,UAAU,CAAC,GAAS,EAAE;QAClB,OAAM;IACV,CAAC,CAAA,CAAC,CAAC;IAEH,IAAA,UAAE,EAAC,iBAAiB,EAAE;;YAClB,MAAM,cAAc,EAAE,CAAC;YACvB,IAAA,aAAM,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YACrC,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA,CAAC,CAAC;IAEH,IAAA,UAAE,EAAC,mCAAmC,EAAE,UAAe,IAAI;;YACvD,IAAI,MAAM,GAAY,KAAK,CAAC;YAC5B,MAAM,WAAW,GAAG,GAAG,EAAE;gBACrB,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;gBACrB,IAAI,EAAE,CAAC;YACX,CAAC,CAAA;YACD,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC,WAAW,CAAC,CAAC;YACjC,MAAM,cAAc,EAAE,CAAC;QAC3B,CAAC;KAAA,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
const mocha_1 = require("mocha");
|
|
51
|
+
const sinon = __importStar(require("sinon"));
|
|
52
|
+
const Const_1 = require("../../impl/core/Const");
|
|
53
|
+
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
54
|
+
const XmlResponses_1 = require("../frameworkBase/_ext/shared/XmlResponses");
|
|
55
|
+
const chai_1 = require("chai");
|
|
56
|
+
const AjaxImpl_1 = require("../../impl/AjaxImpl");
|
|
57
|
+
var errorChainPage = StandardInits_1.StandardInits.errorChainPage;
|
|
58
|
+
const mona_dish_1 = require("mona-dish");
|
|
59
|
+
/**
|
|
60
|
+
* Tests for error recover if an error is triggered mid chain
|
|
61
|
+
*/
|
|
62
|
+
(0, mocha_1.describe)('Tests of the various aspects of the response protocol functionality', function () {
|
|
63
|
+
beforeEach(function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
let waitForResult = errorChainPage(true);
|
|
66
|
+
return waitForResult.then((close) => {
|
|
67
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
68
|
+
this.requests = [];
|
|
69
|
+
this.respond = (response) => {
|
|
70
|
+
response = (0, Const_1.$nsp)(response);
|
|
71
|
+
let xhrReq = this.requests.shift();
|
|
72
|
+
xhrReq.responsetype = "text/xml";
|
|
73
|
+
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, response);
|
|
74
|
+
return xhrReq;
|
|
75
|
+
};
|
|
76
|
+
this.respond403 = (response) => {
|
|
77
|
+
let xhrReq = this.requests.shift();
|
|
78
|
+
xhrReq.responsetype = "text/html";
|
|
79
|
+
xhrReq.respond(403, { 'Content-Type': 'text/html' }, "server error");
|
|
80
|
+
return xhrReq;
|
|
81
|
+
};
|
|
82
|
+
this.xhr.onCreate = (xhr) => {
|
|
83
|
+
this.requests.push(xhr);
|
|
84
|
+
};
|
|
85
|
+
global.XMLHttpRequest = this.xhr;
|
|
86
|
+
window.XMLHttpRequest = this.xhr;
|
|
87
|
+
this.closeIt = () => {
|
|
88
|
+
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
89
|
+
AjaxImpl_1.Implementation.reset();
|
|
90
|
+
close();
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
afterEach(function () {
|
|
96
|
+
this.closeIt();
|
|
97
|
+
});
|
|
98
|
+
it("No Error Case", function (done) {
|
|
99
|
+
mona_dish_1.DQ.byId("form1:button1").click();
|
|
100
|
+
(0, chai_1.expect)(AjaxImpl_1.Implementation.requestQueue.queue.length >= 4).to.be.true;
|
|
101
|
+
for (let cnt = 1; cnt <= 5; cnt++) {
|
|
102
|
+
if (!AjaxImpl_1.Implementation.requestQueue.queue.length) {
|
|
103
|
+
//the last non queued element waits for another response
|
|
104
|
+
this.respond(XmlResponses_1.XmlResponses.ERROR_CHAIN_RESPOND_OK(cnt));
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
this.respond(XmlResponses_1.XmlResponses.ERROR_CHAIN_RESPOND_OK(cnt));
|
|
108
|
+
}
|
|
109
|
+
(0, chai_1.expect)(mona_dish_1.DQ.byId("errorCalled").innerHTML).to.eq("");
|
|
110
|
+
(0, chai_1.expect)(mona_dish_1.DQ.byId("form1:out1").innerHTML).to.eq("5");
|
|
111
|
+
done();
|
|
112
|
+
});
|
|
113
|
+
it("must process the error chain properly", function (done) {
|
|
114
|
+
mona_dish_1.DQ.byId("form1:button1").click();
|
|
115
|
+
(0, chai_1.expect)(AjaxImpl_1.Implementation.requestQueue.queue.length >= 4).to.be.true;
|
|
116
|
+
for (let cnt = 1; cnt <= 5; cnt++) {
|
|
117
|
+
if (!AjaxImpl_1.Implementation.requestQueue.queue.length) {
|
|
118
|
+
this.respond(XmlResponses_1.XmlResponses.ERROR_CHAIN_RESPOND_OK(cnt));
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
if (cnt == 3) {
|
|
122
|
+
//any error suffices
|
|
123
|
+
this.respond403();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.respond(XmlResponses_1.XmlResponses.ERROR_CHAIN_RESPOND_OK(cnt));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
(0, chai_1.expect)(AjaxImpl_1.Implementation.requestQueue.queue.length).to.eq(0);
|
|
130
|
+
(0, chai_1.expect)(mona_dish_1.DQ.byId("errorCalled").innerHTML).to.eq("1");
|
|
131
|
+
(0, chai_1.expect)(mona_dish_1.DQ.byId("form1:out1").innerHTML).to.eq("5");
|
|
132
|
+
done();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
//# sourceMappingURL=ErrorChainTest.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorChainTest.spec.js","sourceRoot":"","sources":["../../../src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,iCAA+B;AAC/B,6CAA+B;AAC/B,iDAA2C;AAC3C,8EAAyE;AACzE,4EAAuE;AACvE,+BAA4B;AAC5B,kDAAmD;AACnD,IAAO,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC;AACrD,yCAA6B;AAE7B;;GAEG;AACH,IAAA,gBAAQ,EAAC,qEAAqE,EAAE;IAE5E,UAAU,CAAC;;YACP,IAAI,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YACzC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBAEhC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAC;gBACzC,IAAI,CAAC,QAAQ,GAAG,E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AAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE;YAC/B,IAAG,CAAC,yBAAc,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE;gBAC1C,IAAI,CAAC,OAAO,CAAC,2BAAY,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvD,MAAM;aACT;YACD,IAAI,GAAG,IAAI,CAAC,EAAE;gBACV,oBAAoB;gBACpB,IAAI,CAAC,UAAU,EAAE,CAAC;aACrB;iBAAM;gBACH,IAAI,CAAC,OAAO,CAAC,2BAAY,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAA;aACzD;SACJ;QACD,IAAA,aAAM,EAAC,yBAAc,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAA,aAAM,EAAC,cAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,cAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -55,6 +55,8 @@ const mona_dish_1 = require("mona-dish");
|
|
|
55
55
|
const Const_1 = require("../../impl/core/Const");
|
|
56
56
|
var defaultMyFacesNamespaces = StandardInits_1.StandardInits.defaultMyFacesNamespaces;
|
|
57
57
|
const querystring_1 = require("querystring");
|
|
58
|
+
const Lang_1 = require("../../impl/util/Lang");
|
|
59
|
+
var ofAssoc = Lang_1.ExtLang.ofAssoc;
|
|
58
60
|
let issueStdReq = function (element) {
|
|
59
61
|
faces.ajax.request(element, null, {
|
|
60
62
|
execute: "input_1",
|
|
@@ -168,6 +170,7 @@ let issueStdReq = function (element) {
|
|
|
168
170
|
}
|
|
169
171
|
});
|
|
170
172
|
(0, mocha_1.it)('must get name prefixed viewstate properly', function () {
|
|
173
|
+
var _a, _b, _c;
|
|
171
174
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
172
175
|
try {
|
|
173
176
|
(0, mona_dish_1.DQ$)(`[name*='${Const_1.P_VIEWSTATE}']`).attr("name").value = `jd_0:${Const_1.P_VIEWSTATE}`;
|
|
@@ -193,11 +196,11 @@ let issueStdReq = function (element) {
|
|
|
193
196
|
(0, chai_1.expect)(resultsMap[NAMING_CONTAINER_PREF + "pass2"]).to.eq("pass2");
|
|
194
197
|
(0, chai_1.expect)(!!resultsMap["render"]).to.be.false;
|
|
195
198
|
(0, chai_1.expect)(!!resultsMap["execute"]).to.be.false;
|
|
196
|
-
let hasWindowdId =
|
|
197
|
-
let hasViewState =
|
|
198
|
-
(0, chai_1.expect)(hasWindowdId).to.be.false;
|
|
199
|
-
(0, chai_1.expect)(hasViewState).to.be.true;
|
|
200
|
-
let viewState =
|
|
199
|
+
let hasWindowdId = (_a = ofAssoc(resultsMap).filter(data => data[0].indexOf(Const_1.P_WINDOW_ID) != -1)) === null || _a === void 0 ? void 0 : _a[0];
|
|
200
|
+
let hasViewState = (_b = ofAssoc(resultsMap).filter(data => data[0].indexOf(Const_1.P_VIEWSTATE) != -1)) === null || _b === void 0 ? void 0 : _b[0];
|
|
201
|
+
(0, chai_1.expect)(!!hasWindowdId).to.be.false;
|
|
202
|
+
(0, chai_1.expect)(!!hasViewState).to.be.true;
|
|
203
|
+
let viewState = (_c = ofAssoc(resultsMap).filter(data => data[0].indexOf(Const_1.P_VIEWSTATE) != -1).map(item => item[1])) === null || _c === void 0 ? void 0 : _c[0];
|
|
201
204
|
(0, chai_1.expect)(viewState).to.eq("booga");
|
|
202
205
|
(0, chai_1.expect)(resultsMap[NAMING_CONTAINER_PREF + Const_1.P_AJAX_SOURCE]).to.eq("jd_0:input_2");
|
|
203
206
|
(0, chai_1.expect)(resultsMap[NAMING_CONTAINER_PREF + Const_1.P_AJAX]).to.eq("true");
|