jsf.js_next_gen 4.0.0-beta-23 → 4.0.0
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/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +7 -22
- package/dist/docs/assets/main.js +56 -52
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +23 -0
- package/dist/docs/functions/faces.ajax.addOnError.html +6 -4
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
- package/dist/docs/functions/faces.ajax.request.html +7 -7
- package/dist/docs/functions/faces.ajax.response.html +0 -1
- package/dist/docs/functions/faces.push.close.html +4 -2
- package/dist/docs/functions/faces.push.init.html +19 -7
- package/dist/docs/functions/faces.push.open.html +4 -2
- package/dist/docs/functions/faces.util.chain.html +3 -3
- package/dist/docs/functions/myfaces.ab.html +9 -4
- package/dist/docs/functions/myfaces.onOnDomReady.html +72 -0
- package/dist/docs/index.html +7 -18
- package/dist/docs/modules/myfaces.html +3 -1
- package/dist/docs/variables/myfaces.oam.html +2 -1
- package/dist/window/faces-development.js +2147 -1779
- 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.LICENSE.txt +17 -2
- 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 +2156 -1777
- 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.LICENSE.txt +17 -2
- 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 +19 -18
- package/pom.xml +1 -1
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +24 -7
- package/src/main/typescript/api/_api.ts +79 -37
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +168 -78
- package/src/main/typescript/impl/PushImpl.ts +63 -38
- package/src/main/typescript/impl/core/Const.ts +52 -39
- package/src/main/typescript/impl/util/Assertions.ts +16 -8
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +4 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +58 -45
- package/src/main/typescript/impl/util/FileUtils.ts +104 -0
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
- package/src/main/typescript/impl/util/Lang.ts +30 -31
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
- package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +202 -131
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +79 -166
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -68
- package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +19 -22
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +108 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +242 -11
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +373 -35
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
- package/src/main/typescript/test.xml +6 -0
- package/src/main/typescript/tsconfig.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/src/tmp/test.html +12 -88
- package/target/api/_api.js +72 -31
- package/target/api/_api.js.map +1 -1
- package/target/api/jsf.js +11 -0
- package/target/api/jsf.js.map +1 -1
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +144 -59
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +66 -35
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +51 -38
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +12 -7
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +58 -40
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +96 -0
- package/target/impl/util/FileUtils.js.map +1 -0
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +79 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/impl/util/Lang.js +29 -30
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/URLCodec.js +77 -0
- package/target/impl/util/URLCodec.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +82 -0
- package/target/impl/util/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +10 -8
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +1 -1
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +70 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +44 -29
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +182 -116
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +68 -156
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrQueHandler.js +11 -0
- package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
- package/target/impl/xhrCore/XhrQueueController.js +62 -0
- package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +68 -59
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +23 -14
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +16 -16
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +100 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/myfaces/OnLoadSpec.js +57 -0
- package/target/test/myfaces/OnLoadSpec.js.map +1 -0
- package/target/test/xhrCore/EventTests.spec.js +1 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +217 -9
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +34 -2
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +308 -24
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/target/types/index.js +0 -18
- package/target/types/index.js.map +0 -1
|
@@ -21,9 +21,9 @@ import * as sinon from "sinon";
|
|
|
21
21
|
|
|
22
22
|
import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
|
|
23
23
|
import {expect} from "chai";
|
|
24
|
-
import {DomQuery, DQ} from "mona-dish";
|
|
24
|
+
import {DomQuery, DQ, DQ$} from "mona-dish";
|
|
25
25
|
import protocolPage = StandardInits.protocolPage;
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
|
|
28
28
|
declare var faces: any;
|
|
29
29
|
declare var Implementation: any;
|
|
@@ -32,7 +32,7 @@ declare var Implementation: any;
|
|
|
32
32
|
* response test
|
|
33
33
|
* the idea is simply to pass in a dom
|
|
34
34
|
* the context and a response xml and then check what happens
|
|
35
|
-
* we do not need to
|
|
35
|
+
* we do not need to go through the entire ajax cycle for that.
|
|
36
36
|
*/
|
|
37
37
|
describe('Tests of the various aspects of the response protocol functionality', function () {
|
|
38
38
|
|
|
@@ -199,7 +199,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
199
199
|
"embedded scripts must be executed").to.be.true;
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
it("must have a
|
|
202
|
+
it("must have a viewState update to be performed", function () {
|
|
203
203
|
DQ.byId("cmd_viewstate").click();
|
|
204
204
|
|
|
205
205
|
this.respond(XmlResponses.VIEWSTATE_1);
|
|
@@ -225,11 +225,11 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
225
225
|
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
-
it("must have updated the viewstates properly", function () {
|
|
228
|
+
it("must have updated the viewstates properly", function (done) {
|
|
229
229
|
DQ.byId("cmd_eval").click();
|
|
230
230
|
/*js full submit form, coming from the integration tests*/
|
|
231
231
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
232
|
-
|
|
232
|
+
><span id="updatePanel">hello world</span><a href="#"
|
|
233
233
|
onclick="return faces.util.chain(this, event,'return false;', 'return myfaces.ab(\'j_id_1l\',\'updateTrigger\');');"
|
|
234
234
|
id="updateTrigger"
|
|
235
235
|
name="updateTrigger"
|
|
@@ -245,18 +245,18 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
245
245
|
|
|
246
246
|
// language=XML
|
|
247
247
|
this.respond(`<?xml version="1.0" encoding="UTF-8"?>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
248
|
+
<partial-response id="j_id__v_0">
|
|
249
|
+
<changes>
|
|
250
|
+
<update id="updatePanel"><![CDATA[<span id="updatePanel">hello world</span>]]></update>
|
|
251
|
+
<update id="j_id__v_0:jakarta.faces.ViewState:1"><![CDATA[RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD]]></update>
|
|
252
|
+
</changes>
|
|
253
|
+
</partial-response>`);
|
|
255
254
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
257
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
258
|
+
done();
|
|
259
|
+
}, 100);
|
|
260
260
|
});
|
|
261
261
|
|
|
262
262
|
|
|
@@ -264,7 +264,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
264
264
|
DQ.byId("cmd_eval").click();
|
|
265
265
|
/*js full submit form, coming from the integration tests*/
|
|
266
266
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
267
|
-
|
|
267
|
+
><span id="updatePanel">hello world</span><a href="#"
|
|
268
268
|
onclick="return faces.util.chain(this, event,'return false;', 'return myfaces.ab(\'j_id_1l\',\'updateTrigger\');');"
|
|
269
269
|
id="updateTrigger"
|
|
270
270
|
name="updateTrigger"
|
|
@@ -280,20 +280,20 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
280
280
|
|
|
281
281
|
// language=XML
|
|
282
282
|
this.respond(`<?xml version="1.0" encoding="UTF-8"?>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
<partial-response id="j_id__v_0">
|
|
284
|
+
<changes>
|
|
285
|
+
<update id="updatePanel"><![CDATA[<span id="updatePanel">hello world</span>]]></update>
|
|
286
|
+
<update id="j_id__v_0:jakarta.faces.ViewState:1"><![CDATA[RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD]]><!--
|
|
287
287
|
Some random junk which is sent by the server
|
|
288
288
|
--></update>
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
</changes>
|
|
290
|
+
</partial-response>`);
|
|
291
291
|
|
|
292
292
|
|
|
293
|
-
expect(DQ
|
|
293
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").isAbsent()).to.be.false;
|
|
294
294
|
|
|
295
|
-
expect((<HTMLInputElement>document.
|
|
296
|
-
expect(DQ
|
|
295
|
+
// expect((<HTMLInputElement>document.getElementsByName("jakarta.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
296
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
297
297
|
});
|
|
298
298
|
|
|
299
299
|
|
|
@@ -357,8 +357,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
357
357
|
});
|
|
358
358
|
|
|
359
359
|
|
|
360
|
-
|
|
361
|
-
it("must handle simple resource responses properly", function(done) {
|
|
360
|
+
it("must handle simple resource responses properly", function (done) {
|
|
362
361
|
|
|
363
362
|
// we need to fake the response as well to see whether the server has loaded the addedViewHead code and has interpreted it
|
|
364
363
|
//(window as any)["test"] = "booga";
|
|
@@ -373,10 +372,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
373
372
|
})
|
|
374
373
|
|
|
375
374
|
|
|
376
|
-
it("only single resources are allowed", function(done) {
|
|
375
|
+
it("only single resources are allowed", function (done) {
|
|
377
376
|
// we need to fake the response as well to see whether the server has loaded the addedViewHead code and has interpreted it
|
|
378
377
|
//(window as any)["test"] = "booga";
|
|
379
|
-
for(let cnt = 0; cnt < 10; cnt++) {
|
|
378
|
+
for (let cnt = 0; cnt < 10; cnt++) {
|
|
380
379
|
DQ.byId("cmd_simple_resource").click();
|
|
381
380
|
this.respond(XmlResponses.MULTIPLE_RESOURCE_RESPONSE);
|
|
382
381
|
}
|
|
@@ -390,7 +389,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
390
389
|
})
|
|
391
390
|
|
|
392
391
|
//TODO implement secondary response mockup
|
|
393
|
-
it("must handle complex resource responses properly", function(done) {
|
|
392
|
+
it("must handle complex resource responses properly", function (done) {
|
|
394
393
|
DQ.byId("cmd_complex_resource").click();
|
|
395
394
|
this.respond(XmlResponses.MULTIPLE_RESOURCE_RESPONSE);
|
|
396
395
|
|
|
@@ -403,14 +402,62 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
403
402
|
.catch(done);
|
|
404
403
|
})
|
|
405
404
|
|
|
406
|
-
it("embedded scripts must be evaled", function(done) {
|
|
405
|
+
it("embedded scripts must be evaled", function (done) {
|
|
407
406
|
|
|
408
407
|
DQ.byId("cmd_complex_resource2").click();
|
|
409
408
|
this.respond(XmlResponses.EMBEDDED_SCRIPTS_RESOURCE_RESPONSE);
|
|
410
|
-
|
|
409
|
+
// this.respond("debugger; document.getElementById('resource_area_1').innerHTML = 'true3'", {'Content-Type': 'text/javascript'});
|
|
411
410
|
let headHTML = document.head.innerHTML;
|
|
412
411
|
expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
|
|
413
|
-
expect(headHTML.indexOf("
|
|
412
|
+
expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
|
|
413
|
+
expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
|
|
414
|
+
setTimeout(() => {
|
|
415
|
+
let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
|
|
416
|
+
//last one must be the last item, order must be preserved
|
|
417
|
+
expect(evalAreaHtml).to.eq("booga");
|
|
418
|
+
done();
|
|
419
|
+
}, 800)
|
|
420
|
+
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
it("head replacement must work (https://issues.apache.org/jira/browse/MYFACES-4498 and TCK Issue 4345IT)", function (done) {
|
|
425
|
+
|
|
426
|
+
DQ.byId("cmd_complex_resource2").click();
|
|
427
|
+
this.respond(XmlResponses.HEAD_REPLACE);
|
|
428
|
+
let headHTML = document.head.innerHTML;
|
|
429
|
+
|
|
430
|
+
//failing now, no elements in the html head after respond!!!
|
|
431
|
+
expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
|
|
432
|
+
expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
|
|
433
|
+
|
|
434
|
+
expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
|
|
435
|
+
setTimeout(() => {
|
|
436
|
+
let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
|
|
437
|
+
//last one must be the last item, order must be preserved
|
|
438
|
+
expect(evalAreaHtml).to.eq("booga");
|
|
439
|
+
done();
|
|
440
|
+
}, 800)
|
|
441
|
+
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
it("complex head replacement must work", function (done) {
|
|
446
|
+
|
|
447
|
+
DQ.byId("cmd_complex_resource2").click();
|
|
448
|
+
this.respond(XmlResponses.HEAD_REPLACE2);
|
|
449
|
+
let headHTML = document.head.innerHTML;
|
|
450
|
+
|
|
451
|
+
//failing now, no elements in the html head after respond!!!
|
|
452
|
+
expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
|
|
453
|
+
expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
|
|
454
|
+
|
|
455
|
+
let metas = DQ$("head meta");
|
|
456
|
+
expect(metas.length).to.eq(5);
|
|
457
|
+
expect(metas.get(0).attr("charSet").value == "UTF-8");
|
|
458
|
+
expect(metas.get(4).attr("author").value == "Whoever");
|
|
459
|
+
|
|
460
|
+
expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
|
|
414
461
|
setTimeout(() => {
|
|
415
462
|
let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
|
|
416
463
|
//last one must be the last item, order must be preserved
|
|
@@ -419,5 +466,296 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
419
466
|
}, 800)
|
|
420
467
|
|
|
421
468
|
})
|
|
469
|
+
const INNER_HTML_MULIT_VIEW = `
|
|
470
|
+
<div id="viewroot_1">
|
|
471
|
+
<form id="viewroot_1:form1">
|
|
472
|
+
<button type="submit" id="viewroot_1:submit_1"></button>
|
|
473
|
+
<input type="hidden" id="viewroot_1:form1:jakarta.faces.ViewState:1" name="jakarta.faces.ViewState" value="booga"></input>
|
|
474
|
+
</form>
|
|
475
|
+
<form id="viewroot_1:form2">
|
|
476
|
+
<button type="submit" id="viewroot_1:submit_2"></button>
|
|
477
|
+
</form>
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
<div id="viewroot_2">
|
|
481
|
+
<form id="viewroot_2:form1">
|
|
482
|
+
<button type="submit" id="viewroot_1:submit_2"></button>
|
|
483
|
+
</form>
|
|
484
|
+
</div>
|
|
485
|
+
`;
|
|
486
|
+
it("must handle multiple view roots", function (done) {
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
|
|
490
|
+
<partial-response id='viewroot_1'>
|
|
491
|
+
<changes>
|
|
492
|
+
<update id='viewroot_1:jakarta.faces.ViewState:1'><![CDATA[updatedVST]]></update>
|
|
493
|
+
</changes>
|
|
494
|
+
</partial-response>`
|
|
495
|
+
|
|
496
|
+
window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
|
|
497
|
+
|
|
498
|
+
faces.ajax.request(window.document.getElementById("viewroot_1:submit_1"), null, {
|
|
499
|
+
"javax.faces.behavior.event": "change",
|
|
500
|
+
execute: "submit_1",
|
|
501
|
+
render: "form1"
|
|
502
|
+
});
|
|
503
|
+
this.respond(RESPONSE_1);
|
|
504
|
+
expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ViewState']").isAbsent()).to.be.true;
|
|
505
|
+
expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
506
|
+
expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ViewState']").val).to.be.eq("updatedVST");
|
|
507
|
+
|
|
508
|
+
done();
|
|
509
|
+
})
|
|
510
|
+
|
|
511
|
+
it("must handle multiple view roots multi forms", function (done) {
|
|
512
|
+
const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
|
|
513
|
+
<partial-response id='viewroot_1'>
|
|
514
|
+
<changes>
|
|
515
|
+
<update id='viewroot_1:jakarta.faces.ViewState:1'><![CDATA[updatedVST]]></update>
|
|
516
|
+
</changes>
|
|
517
|
+
</partial-response>`
|
|
518
|
+
|
|
519
|
+
window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
|
|
520
|
+
global["debug4"] = true;
|
|
521
|
+
faces.ajax.request(window.document.getElementById("viewroot_1:submit_1"), null, {
|
|
522
|
+
"javax.faces.behavior.event": "change",
|
|
523
|
+
execute: "submit_1",
|
|
524
|
+
render: "viewroot_1:form1 submit_2"
|
|
525
|
+
});
|
|
526
|
+
this.respond(RESPONSE_1);
|
|
527
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
528
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
529
|
+
expect(DQ$("#viewroot_2\\:form1\\:form1 [name*='jakarta.faces.ViewState']").isAbsent()).to.be.true;
|
|
530
|
+
|
|
531
|
+
expect(faces.getViewState(DQ$("#viewroot_1\\:form2").getAsElem(0).value).indexOf("jakarta.faces.ViewState=updatedVST") != -1).to.be.true;
|
|
532
|
+
expect(faces.getViewState("viewroot_1:form1").indexOf("jakarta.faces.ViewState=updatedVST") != -1).to.be.true;
|
|
533
|
+
|
|
534
|
+
done();
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
it("must handle multiple view roots with ClientWindow ids", function (done) {
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
|
|
542
|
+
<partial-response id='viewroot_1'>
|
|
543
|
+
<changes>
|
|
544
|
+
<update id='viewroot_1:jakarta.faces.ClientWindow:1'><![CDATA[updatedViewId]]></update>
|
|
545
|
+
</changes>
|
|
546
|
+
</partial-response>`
|
|
547
|
+
|
|
548
|
+
window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
|
|
549
|
+
|
|
550
|
+
faces.ajax.request(window.document.getElementById("viewroot_1:submit_1"), null, {
|
|
551
|
+
"javax.faces.behavior.event": "change",
|
|
552
|
+
execute: "submit_1",
|
|
553
|
+
render: "viewroot_1:form1"
|
|
554
|
+
});
|
|
555
|
+
this.respond(RESPONSE_1);
|
|
556
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
|
|
557
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
558
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
559
|
+
|
|
560
|
+
done();
|
|
561
|
+
})
|
|
562
|
+
|
|
563
|
+
it("must handle multiple view roots multi forms with ClientWindow ids", function (done) {
|
|
564
|
+
const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
|
|
565
|
+
<partial-response id='viewroot_1'>
|
|
566
|
+
<changes>
|
|
567
|
+
<update id='viewroot_1:jakarta.faces.ClientWindow:1'><![CDATA[updatedViewId]]></update>
|
|
568
|
+
</changes>
|
|
569
|
+
</partial-response>`
|
|
570
|
+
|
|
571
|
+
window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
|
|
572
|
+
|
|
573
|
+
faces.ajax.request(window.document.getElementById("viewroot_1:submit_1"), null, {
|
|
574
|
+
"javax.faces.behavior.event": "change",
|
|
575
|
+
execute: "submit_1",
|
|
576
|
+
render: "viewroot_1:form1 :submit_2"
|
|
577
|
+
});
|
|
578
|
+
this.respond(RESPONSE_1);
|
|
579
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
580
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
581
|
+
expect(DQ$("#viewroot_2\\:form1\\:form1 [name*='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
|
|
582
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
583
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
584
|
+
|
|
585
|
+
done();
|
|
586
|
+
})
|
|
587
|
+
|
|
588
|
+
const TCK_790_MARKUP = `
|
|
589
|
+
<div id="panel1">
|
|
590
|
+
<form id="form1" name="form1" method="post"
|
|
591
|
+
action="booga"
|
|
592
|
+
><input id="form1:button" name="form1:button" type="submit"
|
|
593
|
+
value="submit form1 via ajax">
|
|
594
|
+
<input type="hidden" name="jakarta.faces.ViewState"
|
|
595
|
+
id="viewroot_1:jakarta.faces.ViewState:1"
|
|
596
|
+
value="beforeUpdate">
|
|
597
|
+
</form>
|
|
598
|
+
</div>
|
|
599
|
+
<div id="panel2">
|
|
600
|
+
<form id="form2" name="form2" method="post" action="booga2"
|
|
601
|
+
><a href="#" id="form2:link" name="form2:link"></a>
|
|
602
|
+
</form>
|
|
603
|
+
</div>
|
|
604
|
+
<div id="panel3">
|
|
605
|
+
<form id="form3" name="form3" method="post" action="booga3"
|
|
606
|
+
><a href="#" id="form3:link" name="form3:link"></a>
|
|
607
|
+
</form>
|
|
608
|
+
</div>
|
|
609
|
+
`;
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
const TCK_790_NAV_MARKUP = `
|
|
613
|
+
<form id="form1x" name="form1" method="post"
|
|
614
|
+
action="booga"
|
|
615
|
+
><input id="form1x:button" name="form1x:button" type="submit"
|
|
616
|
+
value="submit form1 via ajax">
|
|
617
|
+
<input type="hidden" name="jakarta.faces.ViewState"
|
|
618
|
+
id="viewroot_1:jakarta.faces.ViewState:1"
|
|
619
|
+
value="beforeUpdate">
|
|
620
|
+
</form>
|
|
621
|
+
`;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Similar to TCK 790
|
|
625
|
+
*/
|
|
626
|
+
it("must handle a more complex replace with several forms and one issuing form and a viewstate and a viewroot id in response but viewroot is not present in page", function (done) { //special case, viewid given but no viewid in page special result all render and executes must be updated
|
|
627
|
+
|
|
628
|
+
document.body.innerHTML = TCK_790_MARKUP;
|
|
629
|
+
|
|
630
|
+
const RESPONSE_1 = `<partial-response id="viewroot_1">
|
|
631
|
+
<changes>
|
|
632
|
+
<update id="panel2"><![CDATA[
|
|
633
|
+
<div id="panel2">
|
|
634
|
+
after update
|
|
635
|
+
<form id="form2" name="form2" method="post" action="booga2"
|
|
636
|
+
><a href="#" id="form2:link" name="form2:link"></a>
|
|
637
|
+
<input type="hidden" name="form2_SUBMIT" value="1"/></form>
|
|
638
|
+
</div>
|
|
639
|
+
]]>
|
|
640
|
+
</update>
|
|
641
|
+
<update id="panel3"><![CDATA[
|
|
642
|
+
<div id="panel3">
|
|
643
|
+
after update
|
|
644
|
+
<form id="form3" name="form3" method="post" action="booga3"
|
|
645
|
+
><a href="#" id="form3:link" name="form3:link"></a>
|
|
646
|
+
</form>
|
|
647
|
+
</div>
|
|
648
|
+
]]>
|
|
649
|
+
</update>
|
|
650
|
+
<update id="viewroot_1:jakarta.faces.ViewState:1"><![CDATA[booga_after_update]]></update>
|
|
651
|
+
</changes>
|
|
652
|
+
</partial-response>`;
|
|
653
|
+
faces.ajax.request(window.document.getElementById("form1:button"), null, {
|
|
654
|
+
"javax.faces.behavior.event": "click",
|
|
655
|
+
execute: "form1",
|
|
656
|
+
render: "form2 form3"
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
this.respond(RESPONSE_1);
|
|
660
|
+
// all forms in execute and render must receive the latest viewstate
|
|
661
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
662
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
663
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
664
|
+
done();
|
|
665
|
+
})
|
|
666
|
+
|
|
667
|
+
it("must handle a complex navigation response (TCK Spec790)", function (done) {
|
|
668
|
+
/*we start from a simple form which triggers a an internal navigation*/
|
|
669
|
+
document.body.innerHTML = TCK_790_NAV_MARKUP;
|
|
670
|
+
|
|
671
|
+
faces.ajax.request(window.document.getElementById("form1x:button"), null, {
|
|
672
|
+
"javax.faces.behavior.event": "click",
|
|
673
|
+
execute: "@form",
|
|
674
|
+
render: ":form1x:button"
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
//TODO xhr stubbing, to check if the viewId is prepended in render!
|
|
678
|
+
|
|
679
|
+
this.respond(`<?xml version="1.0" encoding="UTF-8"?>
|
|
680
|
+
<partial-response id="viewroot_1">
|
|
681
|
+
<changes>
|
|
682
|
+
<update id="jakarta.faces.ViewRoot"><![CDATA[<!DOCTYPE html>
|
|
683
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
684
|
+
<head>
|
|
685
|
+
<title>Spec 790</title>
|
|
686
|
+
<script src="/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces;stage=Development"></script>
|
|
687
|
+
</head>
|
|
688
|
+
<body>
|
|
689
|
+
<div id="panel1">
|
|
690
|
+
<form id="form1" name="form1" method="post"
|
|
691
|
+
action="booga"
|
|
692
|
+
><input id="form1:button" name="form1:button" type="submit"
|
|
693
|
+
value="submit form1 via ajax">
|
|
694
|
+
</form>
|
|
695
|
+
</div>
|
|
696
|
+
<div id="panel2">
|
|
697
|
+
after update
|
|
698
|
+
<form id="form2" name="form2" method="post" action="booga2"
|
|
699
|
+
><a href="#" id="form2:link" name="form2:link"></a>
|
|
700
|
+
<input type="hidden" name="form2_SUBMIT" value="1"/></form>
|
|
701
|
+
</div>
|
|
702
|
+
<div id="panel3">
|
|
703
|
+
after update
|
|
704
|
+
<form id="form3" name="form3" method="post" action="booga3"
|
|
705
|
+
><a href="#" id="form3:link" name="form3:link"></a>
|
|
706
|
+
</form>
|
|
707
|
+
</div>
|
|
708
|
+
</body>
|
|
709
|
+
</html>
|
|
710
|
+
]]>
|
|
711
|
+
</update>
|
|
712
|
+
<update id="viewroot_1:jakarta.faces.ViewState:1"><![CDATA[booga_after_update]]></update>
|
|
713
|
+
</changes>
|
|
714
|
+
</partial-response>
|
|
715
|
+
`)
|
|
716
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
717
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
718
|
+
expect(DQ$("#form3 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
719
|
+
|
|
720
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:0") === 0).to.be.true;
|
|
721
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:1") === 0).to.be.true;
|
|
722
|
+
expect(DQ$("#form3 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:2") === 0).to.be.true;
|
|
723
|
+
|
|
724
|
+
done();
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
it('must handle a ViewExpired Error correctly, and only once in a listener', function (done) {
|
|
728
|
+
|
|
729
|
+
document.body.innerHTML = TCK_790_NAV_MARKUP;
|
|
730
|
+
|
|
731
|
+
let errorCalled = 0;
|
|
732
|
+
faces.ajax.addOnError((error)=> {
|
|
733
|
+
expect(error.errorName).to.eq("jakarta.faces.application.ViewExpiredException");
|
|
734
|
+
expect(error.errorMessage).to.eq("serverError: View \"/testhmtl.xhtml\" could not be restored.");
|
|
735
|
+
expect(error.source.id).to.eq("form1x:button");
|
|
736
|
+
errorCalled++;
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
faces.ajax.request(window.document.getElementById("form1x:button"), null, {
|
|
740
|
+
"javax.faces.behavior.event": "click",
|
|
741
|
+
execute: "@form",
|
|
742
|
+
render: ":form1x:button"
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
this.respond(`<?xml version="1.0" encoding="UTF-8"?>
|
|
746
|
+
<partial-response><error>
|
|
747
|
+
<error-name>jakarta.faces.application.ViewExpiredException</error-name>
|
|
748
|
+
<error-message><![CDATA[View "/testhmtl.xhtml" could not be restored.]]></error-message>
|
|
749
|
+
</error>
|
|
750
|
+
</partial-response>`)
|
|
751
|
+
|
|
752
|
+
expect(errorCalled).to.eq(1);
|
|
753
|
+
|
|
754
|
+
done();
|
|
755
|
+
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
422
760
|
|
|
423
761
|
});
|
|
@@ -22,8 +22,10 @@ import * as sinon from "sinon";
|
|
|
22
22
|
import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
|
|
23
23
|
import {expect} from "chai";
|
|
24
24
|
import protocolPage = StandardInits.protocolPage;
|
|
25
|
-
import {DQ} from "mona-dish";
|
|
25
|
+
import {DQ, DQ$} from "mona-dish";
|
|
26
26
|
import {$nsp} from "../../impl/core/Const";
|
|
27
|
+
import STD_XML = StandardInits.STD_XML;
|
|
28
|
+
import HTML_PREFIX_EMBEDDED_BODY = StandardInits.HTML_PREFIX_EMBEDDED_BODY;
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
declare var jsf: any;
|
|
@@ -226,7 +228,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
226
228
|
|
|
227
229
|
});
|
|
228
230
|
|
|
229
|
-
it("must have updated the viewstates properly", function () {
|
|
231
|
+
it("must have updated the viewstates properly 2.3", function () {
|
|
230
232
|
DQ.byId("cmd_eval").click();
|
|
231
233
|
/*js full submit form, coming from the integration tests*/
|
|
232
234
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
@@ -254,14 +256,14 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
254
256
|
</partial-response>`);
|
|
255
257
|
|
|
256
258
|
|
|
257
|
-
expect(DQ
|
|
259
|
+
expect(DQ$("[name*='javax.faces.ViewState']").isAbsent()).to.be.false;
|
|
258
260
|
|
|
259
|
-
expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
260
|
-
expect(DQ
|
|
261
|
+
//expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
262
|
+
expect(DQ$("[name*='javax.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
261
263
|
});
|
|
262
264
|
|
|
263
265
|
|
|
264
|
-
it("must have updated the viewstates properly with lenient update block", function () {
|
|
266
|
+
it("must have updated the viewstates properly with lenient update block 2.3", function () {
|
|
265
267
|
DQ.byId("cmd_eval").click();
|
|
266
268
|
/*js full submit form, coming from the integration tests*/
|
|
267
269
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
@@ -291,10 +293,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
291
293
|
</partial-response>`);
|
|
292
294
|
|
|
293
295
|
|
|
294
|
-
expect(DQ
|
|
296
|
+
expect(DQ$("[name*='javax.faces.ViewState']").isAbsent()).to.be.false;
|
|
295
297
|
|
|
296
|
-
expect((<HTMLInputElement>document.
|
|
297
|
-
expect(DQ
|
|
298
|
+
//expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
299
|
+
expect(DQ$("[name*='javax.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
298
300
|
});
|
|
299
301
|
|
|
300
302
|
|
|
@@ -357,6 +359,38 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
357
359
|
expect(DQ.byId("j_id__v_0:javax.faces.ClientWindow:1").isAbsent()).to.be.false;
|
|
358
360
|
});
|
|
359
361
|
|
|
362
|
+
|
|
363
|
+
it("must pass named params properly (tobago testcase)", function(done) {
|
|
364
|
+
window.document.body.innerHTML = HTML_PREFIX_EMBEDDED_BODY;
|
|
365
|
+
try {
|
|
366
|
+
|
|
367
|
+
let event = {
|
|
368
|
+
isTrusted: true,
|
|
369
|
+
type: 'change',
|
|
370
|
+
target: document.getElementById("page:input::field"),
|
|
371
|
+
currentTarget: document.getElementById("page:input::field")
|
|
372
|
+
};
|
|
373
|
+
jsf.ajax.request(document.getElementById("page:input"), event as any, {
|
|
374
|
+
render: "page:output",
|
|
375
|
+
execute: "page:input",
|
|
376
|
+
params: {
|
|
377
|
+
"booga2.xxx": "yyy",
|
|
378
|
+
"javax.faces.behavior.event": "change",
|
|
379
|
+
"booga": "bla"
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
} catch (err) {
|
|
383
|
+
console.error(err);
|
|
384
|
+
expect(false).to.eq(true);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const requestBody = this.requests[0].requestBody;
|
|
388
|
+
expect(requestBody.indexOf("javax.faces.behavior.event")).to.not.eq(-1);
|
|
389
|
+
expect(requestBody.indexOf("javax.faces.behavior.event=change")).to.not.eq(-1);
|
|
390
|
+
expect(requestBody.indexOf("page%3Ainput=input_value")).to.not.eq(-1);
|
|
391
|
+
done();
|
|
392
|
+
|
|
393
|
+
});
|
|
360
394
|
|
|
361
395
|
|
|
362
396
|
});
|