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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {describe, it} from "mocha";
|
|
18
|
+
import * as sinon from "sinon";
|
|
19
|
+
import {expect} from "chai";
|
|
20
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
+
import {DomQuery, DQ$, Stream} from "mona-dish";
|
|
22
|
+
import {
|
|
23
|
+
$nsp,
|
|
24
|
+
COMPLETE,
|
|
25
|
+
P_AJAX,
|
|
26
|
+
P_EXECUTE,
|
|
27
|
+
P_PARTIAL_SOURCE,
|
|
28
|
+
P_RENDER,
|
|
29
|
+
P_VIEWSTATE,
|
|
30
|
+
P_WINDOW_ID,
|
|
31
|
+
SUCCESS
|
|
32
|
+
} from "../../impl/core/Const";
|
|
33
|
+
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
34
|
+
import STD_XML = StandardInits.STD_XML;
|
|
35
|
+
import defaultMyFacesNamespaces = StandardInits.defaultMyFacesNamespaces;
|
|
36
|
+
import {escape} from "querystring";
|
|
37
|
+
|
|
38
|
+
declare var faces: any;
|
|
39
|
+
declare var Implementation: any;
|
|
40
|
+
|
|
41
|
+
let issueStdReq = function (element) {
|
|
42
|
+
faces.ajax.request(element, null, {
|
|
43
|
+
execute: "input_1",
|
|
44
|
+
render: "@form",
|
|
45
|
+
params: {
|
|
46
|
+
pass1: "pass1",
|
|
47
|
+
pass2: "pass2"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
describe('Namespacing tests', function () {
|
|
53
|
+
beforeEach(async function () {
|
|
54
|
+
|
|
55
|
+
let waitForResult = defaultMyFacesNamespaces();
|
|
56
|
+
|
|
57
|
+
return waitForResult.then((close) => {
|
|
58
|
+
|
|
59
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
60
|
+
this.requests = [];
|
|
61
|
+
this.xhr.onCreate = (xhr) => {
|
|
62
|
+
this.requests.push(xhr);
|
|
63
|
+
};
|
|
64
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
65
|
+
window.XMLHttpRequest = this.xhr;
|
|
66
|
+
|
|
67
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
68
|
+
|
|
69
|
+
this.closeIt = () => {
|
|
70
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
71
|
+
this.jsfAjaxResponse.restore();
|
|
72
|
+
Implementation.reset();
|
|
73
|
+
close();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
afterEach(function () {
|
|
79
|
+
this.closeIt();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('must send the element identifiers properly encoded', function () {
|
|
83
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
84
|
+
try {
|
|
85
|
+
global["debug3"] = true;
|
|
86
|
+
faces.ajax.request(document.getElementById("jd_0:input_2"), null, {
|
|
87
|
+
execute: ":input_1",
|
|
88
|
+
render: ":blarg :input_2",
|
|
89
|
+
params: {
|
|
90
|
+
pass1: "pass1",
|
|
91
|
+
pass2: "pass2"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
expect(send.called).to.be.true;
|
|
96
|
+
let argsVal: any = send.args[0][0];
|
|
97
|
+
let arsArr = argsVal.split("&");
|
|
98
|
+
let resultsMap = {};
|
|
99
|
+
for (let val of arsArr) {
|
|
100
|
+
let keyVal = val.split("=");
|
|
101
|
+
resultsMap[keyVal[0]] = keyVal[1];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
expect(resultsMap["pass1"]).to.eq("pass1");
|
|
105
|
+
expect(resultsMap["pass2"]).to.eq("pass2");
|
|
106
|
+
expect(!!resultsMap["render"]).to.be.false;
|
|
107
|
+
expect(!!resultsMap["execute"]).to.be.false;
|
|
108
|
+
expect(P_WINDOW_ID in resultsMap).to.be.false;
|
|
109
|
+
expect(P_VIEWSTATE in resultsMap).to.be.true;
|
|
110
|
+
expect(resultsMap[P_PARTIAL_SOURCE]).to.eq(escape("jd_0:input_2"));
|
|
111
|
+
expect(resultsMap[P_AJAX]).to.eq("true");
|
|
112
|
+
expect(resultsMap[P_RENDER]).to.eq(escape("jd_0:blarg jd_0:input_2"));
|
|
113
|
+
expect(resultsMap[P_EXECUTE]).to.eq(escape("jd_0:input_1 jd_0:input_2"));
|
|
114
|
+
} finally {
|
|
115
|
+
send.restore();
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it('must send the element identifiers properly encoded 2', function () {
|
|
120
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
121
|
+
try {
|
|
122
|
+
faces.ajax.request(document.getElementById("jd_0:input_2"), null, {
|
|
123
|
+
execute: "jd_0:input_1",
|
|
124
|
+
render: ":blarg jd_0:input_2",
|
|
125
|
+
params: {
|
|
126
|
+
pass1: "pass1",
|
|
127
|
+
pass2: "pass2"
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
expect(send.called).to.be.true;
|
|
132
|
+
let argsVal: any = send.args[0][0];
|
|
133
|
+
let arsArr = argsVal.split("&");
|
|
134
|
+
let resultsMap = {};
|
|
135
|
+
for (let val of arsArr) {
|
|
136
|
+
let keyVal = val.split("=");
|
|
137
|
+
resultsMap[keyVal[0]] = keyVal[1];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
expect(resultsMap["pass1"]).to.eq("pass1");
|
|
141
|
+
expect(resultsMap["pass2"]).to.eq("pass2");
|
|
142
|
+
expect(!!resultsMap["render"]).to.be.false;
|
|
143
|
+
expect(!!resultsMap["execute"]).to.be.false;
|
|
144
|
+
expect(P_WINDOW_ID in resultsMap).to.be.false;
|
|
145
|
+
expect(P_VIEWSTATE in resultsMap).to.be.true;
|
|
146
|
+
expect(resultsMap[P_PARTIAL_SOURCE]).to.eq(escape("jd_0:input_2"));
|
|
147
|
+
expect(resultsMap[P_AJAX]).to.eq("true");
|
|
148
|
+
expect(resultsMap[P_RENDER]).to.eq(escape("jd_0:blarg jd_0:input_2"));
|
|
149
|
+
expect(resultsMap[P_EXECUTE]).to.eq(escape("jd_0:input_1 jd_0:input_2"));
|
|
150
|
+
} finally {
|
|
151
|
+
send.restore();
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
it('must get name prefixed viewstate properly', function () {
|
|
157
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
158
|
+
try {
|
|
159
|
+
DQ$(`[name*='${P_VIEWSTATE}']`).attr("name").value = `jd_0:${P_VIEWSTATE}`;
|
|
160
|
+
DQ$(`[name*='${P_VIEWSTATE}']`).val = "booga";
|
|
161
|
+
|
|
162
|
+
faces.ajax.request(document.getElementById("jd_0:input_2"), null, {
|
|
163
|
+
execute: "jd_0:input_1",
|
|
164
|
+
render: ":blarg jd_0:input_2",
|
|
165
|
+
params: {
|
|
166
|
+
pass1: "pass1",
|
|
167
|
+
pass2: "pass2"
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
expect(send.called).to.be.true;
|
|
172
|
+
let argsVal: any = send.args[0][0];
|
|
173
|
+
let arsArr = argsVal.split("&");
|
|
174
|
+
let resultsMap = {};
|
|
175
|
+
for (let val of arsArr) {
|
|
176
|
+
let keyVal = val.split("=");
|
|
177
|
+
resultsMap[unescape(keyVal[0])] = unescape(keyVal[1]);
|
|
178
|
+
}
|
|
179
|
+
const NAMING_CONTAINER_PREF = "jd_0:";
|
|
180
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + "pass1"]).to.eq("pass1");
|
|
181
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + "pass2"]).to.eq("pass2");
|
|
182
|
+
expect(!!resultsMap["render"]).to.be.false;
|
|
183
|
+
expect(!!resultsMap["execute"]).to.be.false;
|
|
184
|
+
|
|
185
|
+
let hasWindowdId = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_WINDOW_ID) != -1).first().isPresent();
|
|
186
|
+
let hasViewState = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_VIEWSTATE) != -1).first().isPresent();
|
|
187
|
+
|
|
188
|
+
expect(hasWindowdId).to.be.false;
|
|
189
|
+
expect(hasViewState).to.be.true;
|
|
190
|
+
|
|
191
|
+
let viewState = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_VIEWSTATE) != -1).map(item => item[1]).first().value;
|
|
192
|
+
|
|
193
|
+
expect(viewState).to.eq("booga");
|
|
194
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + P_PARTIAL_SOURCE]).to.eq("jd_0:input_2");
|
|
195
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + P_AJAX]).to.eq("true");
|
|
196
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + P_RENDER]).to.eq("jd_0:blarg jd_0:input_2");
|
|
197
|
+
expect(resultsMap[NAMING_CONTAINER_PREF + P_EXECUTE]).to.eq("jd_0:input_1 jd_0:input_2");
|
|
198
|
+
} finally {
|
|
199
|
+
send.restore();
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {describe} from "mocha";
|
|
18
|
+
import * as sinon from "sinon";
|
|
19
|
+
import {Implementation} from "../../impl/AjaxImpl";
|
|
20
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
+
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
|
+
import {DQ, DQ$} from "mona-dish";
|
|
23
|
+
import {expect} from "chai";
|
|
24
|
+
|
|
25
|
+
describe('Tests for the MyFaces specifig oam submit', function () {
|
|
26
|
+
|
|
27
|
+
beforeEach(async function () {
|
|
28
|
+
|
|
29
|
+
let waitForResult = defaultMyFaces();
|
|
30
|
+
|
|
31
|
+
return waitForResult.then((close) => {
|
|
32
|
+
|
|
33
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
34
|
+
this.requests = [];
|
|
35
|
+
this.xhr.onCreate = (xhr) => {
|
|
36
|
+
this.requests.push(xhr);
|
|
37
|
+
};
|
|
38
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
39
|
+
window.XMLHttpRequest = this.xhr;
|
|
40
|
+
|
|
41
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
42
|
+
|
|
43
|
+
this.closeIt = () => {
|
|
44
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
45
|
+
this.jsfAjaxResponse.restore();
|
|
46
|
+
Implementation.reset();
|
|
47
|
+
close();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
afterEach(function () {
|
|
53
|
+
this.closeIt();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it(("must handle oam submit correctly, tuples"), (done) => {
|
|
57
|
+
|
|
58
|
+
let options = [["booga1", "value1"], ["booga2", "value2"]];
|
|
59
|
+
|
|
60
|
+
(DQ.byId("blarg")
|
|
61
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
62
|
+
expect(DQ$("#blarg #booga1").inputValue.value).to.eq("value1");
|
|
63
|
+
expect(DQ$("#blarg #booga2").inputValue.value).to.eq("value2");
|
|
64
|
+
done();
|
|
65
|
+
return false;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
myfaces.oam.submitForm("blarg", null, null, options);
|
|
69
|
+
|
|
70
|
+
});
|
|
71
|
+
it(("must handle oam submit correctly, associative array"), (done) => {
|
|
72
|
+
|
|
73
|
+
let options = {"booga1": "value1", "booga2": "value2"};
|
|
74
|
+
|
|
75
|
+
(DQ.byId("blarg")
|
|
76
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
77
|
+
expect(DQ$("#blarg #booga1").inputValue.value).to.eq("value1");
|
|
78
|
+
expect(DQ$("#blarg #booga2").inputValue.value).to.eq("value2");
|
|
79
|
+
done();
|
|
80
|
+
return false;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
myfaces.oam.submitForm("blarg", null, null, options);
|
|
84
|
+
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it(("all hidden inputs must be cleared post submit"), (done) => {
|
|
88
|
+
|
|
89
|
+
let options = {"booga1": "value1", "booga2": "value2"};
|
|
90
|
+
|
|
91
|
+
(DQ.byId("blarg")
|
|
92
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
93
|
+
expect(DQ$("#blarg #booga1").length).to.eq(1);
|
|
94
|
+
expect(DQ$("#blarg #booga2").length).to.eq(1);
|
|
95
|
+
return false;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
myfaces.oam.submitForm("blarg", null, null, options);
|
|
99
|
+
|
|
100
|
+
expect(DQ$("#blarg #booga1").length).to.eq(0);
|
|
101
|
+
expect(DQ$("#blarg #booga2").length).to.eq(0);
|
|
102
|
+
done();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it(("must handle linkid correctly, associative array"), (done) => {
|
|
106
|
+
|
|
107
|
+
let options = {"booga1": "value1", "booga2": "value2"};
|
|
108
|
+
|
|
109
|
+
(DQ.byId("blarg")
|
|
110
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
111
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
112
|
+
done();
|
|
113
|
+
return false;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
myfaces.oam.submitForm("blarg", "bla", null, options);
|
|
117
|
+
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it(("must handle target correctly, associative array"), (done) => {
|
|
121
|
+
|
|
122
|
+
let options = {"booga1": "value1", "booga2": "value2"};
|
|
123
|
+
(DQ.byId("blarg")
|
|
124
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
125
|
+
expect(DQ$(`#blarg`).attr("target").value).to.eq("target1");
|
|
126
|
+
done();
|
|
127
|
+
return false;
|
|
128
|
+
};
|
|
129
|
+
myfaces.oam.submitForm("blarg", "bla", "target1", options);
|
|
130
|
+
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it(("must handle limited parameters"), (done) => {
|
|
134
|
+
|
|
135
|
+
(DQ.byId("blarg")
|
|
136
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
137
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
138
|
+
done();
|
|
139
|
+
return false;
|
|
140
|
+
};
|
|
141
|
+
try {
|
|
142
|
+
myfaces.oam.submitForm("blarg", "bla");
|
|
143
|
+
} catch(e) {
|
|
144
|
+
done(e);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
});
|
|
148
|
+
it(("must handle limited parameters 2"), (done) => {
|
|
149
|
+
|
|
150
|
+
(DQ.byId("blarg")
|
|
151
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
152
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
153
|
+
done();
|
|
154
|
+
return false;
|
|
155
|
+
};
|
|
156
|
+
try {
|
|
157
|
+
myfaces.oam.submitForm("blarg", "bla", null);
|
|
158
|
+
} catch(e) {
|
|
159
|
+
done(e);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
it(("must handle limited parameters 3"), (done) => {
|
|
163
|
+
|
|
164
|
+
(DQ.byId("blarg")
|
|
165
|
+
.getAsElem(0).value as HTMLFormElement).onsubmit = (evt) => {
|
|
166
|
+
expect(DQ.byId(`blarg:_idcl`).inputValue.value).to.eq("bla");
|
|
167
|
+
done();
|
|
168
|
+
return false;
|
|
169
|
+
};
|
|
170
|
+
try {
|
|
171
|
+
myfaces.oam.submitForm("blarg", "bla", null, null);
|
|
172
|
+
} catch(e) {
|
|
173
|
+
done(e);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
});
|
|
@@ -18,9 +18,47 @@ import {Implementation} from "../../impl/AjaxImpl";
|
|
|
18
18
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
19
19
|
|
|
20
20
|
import protocolPage = StandardInits.protocolPage;
|
|
21
|
-
import {DQ} from "mona-dish";
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
21
|
+
import {Config, DQ, Stream} from "mona-dish";
|
|
22
|
+
import {expect} from "chai";
|
|
23
|
+
import HTML_PREFIX_EMBEDDED_BODY = StandardInits.HTML_PREFIX_EMBEDDED_BODY;
|
|
24
|
+
import {it} from "mocha";
|
|
25
|
+
import {decodeEncodedValues} from "../../impl/util/FileUtils";
|
|
26
|
+
import {ExtConfig} from "../../impl/util/ExtDomQuery";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* merges a list of key value entries into a target config
|
|
30
|
+
* @param target the target receiving the key value entries
|
|
31
|
+
* @param keyValueEntries a list of key value entries divided by =
|
|
32
|
+
* @param paramsMapper a key value remapper
|
|
33
|
+
*/
|
|
34
|
+
function mergeKeyValueEntries(target: Config, keyValueEntries: Stream<string[]>, paramsMapper = (key, value) => [key, value]) {
|
|
35
|
+
|
|
36
|
+
function fixKeyWithoutVal(keyVal: string[]) {
|
|
37
|
+
return keyVal.length < 3 ? [keyVal?.[0] ?? [], keyVal?.[1] ?? []] : keyVal;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let toMerge = new ExtConfig({});
|
|
41
|
+
keyValueEntries
|
|
42
|
+
//special case of having keys without values
|
|
43
|
+
.map(keyVal => fixKeyWithoutVal(keyVal))
|
|
44
|
+
.map(keyVal => paramsMapper(keyVal[0] as string, keyVal[1]))
|
|
45
|
+
.each(keyVal => {
|
|
46
|
+
let value = keyVal?.splice(1)?.join("") ?? "";
|
|
47
|
+
if(toMerge.getIfPresent(keyVal[0]).isPresent()) {
|
|
48
|
+
toMerge.append(keyVal[0] as string).value = value;
|
|
49
|
+
} else {
|
|
50
|
+
toMerge.assign(keyVal[0] as string).value = value;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
target.shallowMerge(toMerge);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function getFormData(requestBody: string): Config {
|
|
58
|
+
let ret = new Config({});
|
|
59
|
+
mergeKeyValueEntries(ret, decodeEncodedValues(requestBody));
|
|
60
|
+
return ret;
|
|
61
|
+
}
|
|
24
62
|
|
|
25
63
|
describe("test for proper request param patterns identical to the old implementation", function () {
|
|
26
64
|
const UPDATE_INSERT_2 = {
|
|
@@ -35,12 +73,12 @@ describe("test for proper request param patterns identical to the old implementa
|
|
|
35
73
|
/**
|
|
36
74
|
* matches two maps for absolute identicality
|
|
37
75
|
*/
|
|
38
|
-
let matches = (item1: {[key: string]: any}, item2: {[key: string]: any}): boolean => {
|
|
39
|
-
if(Object.keys(item1).length != Object.keys(item2).length) {
|
|
76
|
+
let matches = (item1: { [key: string]: any }, item2: { [key: string]: any }): boolean => {
|
|
77
|
+
if (Object.keys(item1).length != Object.keys(item2).length) {
|
|
40
78
|
return false;
|
|
41
79
|
}
|
|
42
|
-
for(let key in item1) {
|
|
43
|
-
if((!(key in item2)) || item1[key] != item2[key]) {
|
|
80
|
+
for (let key in item1) {
|
|
81
|
+
if ((!(key in item2)) || item1[key] != item2[key]) {
|
|
44
82
|
return false;
|
|
45
83
|
}
|
|
46
84
|
}
|
|
@@ -77,50 +115,153 @@ describe("test for proper request param patterns identical to the old implementa
|
|
|
77
115
|
this.closeIt();
|
|
78
116
|
});
|
|
79
117
|
|
|
80
|
-
it("must pass updateinsert2 with proper parameters", function() {
|
|
118
|
+
it("must pass updateinsert2 with proper parameters", function () {
|
|
81
119
|
DQ.byId("cmd_update_insert2").click();
|
|
82
120
|
|
|
83
121
|
let requestBody = this.requests[0].requestBody;
|
|
84
|
-
let formData =
|
|
122
|
+
let formData = getFormData(requestBody);
|
|
85
123
|
|
|
86
124
|
expect(matches(formData.value, UPDATE_INSERT_2)).to.be.true;
|
|
87
|
-
|
|
88
125
|
});
|
|
89
126
|
|
|
90
127
|
|
|
91
|
-
it("must handle base64 encoded strings properly as request data", function() {
|
|
128
|
+
it("must handle base64 encoded strings properly as request data", function () {
|
|
92
129
|
let probe = "YWFhYWFhc1Rlc3RpdCDDpGtvNDU5NjczMDA9PSsrNDU5MGV3b3UkJiUmLyQmJQ==";
|
|
93
130
|
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
94
131
|
DQ.byId("cmd_update_insert2").click();
|
|
95
132
|
let requestBody = this.requests[0].requestBody;
|
|
96
133
|
//We check if the base64 encoded string matches the original
|
|
97
|
-
let formData =
|
|
134
|
+
let formData = getFormData(requestBody);
|
|
98
135
|
|
|
99
|
-
expect(
|
|
136
|
+
expect(formData.getIf("jakarta.faces.ViewState").value == probe).to.be.true;
|
|
100
137
|
});
|
|
101
138
|
|
|
102
139
|
|
|
103
|
-
it("must handle empty parameters properly", function() {
|
|
140
|
+
it("must handle empty parameters properly", function () {
|
|
104
141
|
let probe = "";
|
|
105
142
|
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
106
143
|
DQ.byId("cmd_update_insert2").click();
|
|
107
144
|
let requestBody = this.requests[0].requestBody;
|
|
108
145
|
//We check if the base64 encoded string matches the original
|
|
109
|
-
let formData =
|
|
146
|
+
let formData = getFormData(requestBody);
|
|
110
147
|
|
|
111
148
|
expect(decodeURIComponent(formData.getIf("jakarta.faces.ViewState").value) == probe).to.be.true;
|
|
112
149
|
});
|
|
113
150
|
|
|
114
151
|
//KssbpZfCe+0lwDhgMRQ44wRFkaM1o1lbMMUO3lini5YhXWm6
|
|
115
152
|
|
|
116
|
-
it("must handle base64 special cases properly (+ in encoding)", function() {
|
|
153
|
+
it("must handle base64 special cases properly (+ in encoding)", function () {
|
|
117
154
|
let probe = "KssbpZfCe+0lwDhgMRQ44wRFkaM1o1lbMMUO3lini5YhXWm6";
|
|
118
155
|
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
119
156
|
DQ.byId("cmd_update_insert2").click();
|
|
120
157
|
let requestBody = this.requests[0].requestBody;
|
|
121
158
|
//We check if the base64 encoded string matches the original
|
|
122
|
-
let formData =
|
|
159
|
+
let formData = getFormData(requestBody);
|
|
123
160
|
|
|
124
161
|
expect(decodeURIComponent(formData.getIf("jakarta.faces.ViewState").value) == probe).to.be.true;
|
|
125
162
|
});
|
|
163
|
+
|
|
164
|
+
it("must handle prefixed inputs properly (prefixes must be present) faces4", function (done) {
|
|
165
|
+
window.document.body.innerHTML = HTML_PREFIX_EMBEDDED_BODY;
|
|
166
|
+
|
|
167
|
+
global["debug_inp"] = true;
|
|
168
|
+
//we now run the tests here
|
|
169
|
+
try {
|
|
170
|
+
|
|
171
|
+
let event = {
|
|
172
|
+
isTrusted: true,
|
|
173
|
+
type: 'change',
|
|
174
|
+
target: document.getElementById("page:input::field"),
|
|
175
|
+
currentTarget: document.getElementById("page:input::field")
|
|
176
|
+
};
|
|
177
|
+
faces.ajax.request(document.getElementById("page:input"), event as any, {
|
|
178
|
+
render: "page:output",
|
|
179
|
+
execute: "page:input",
|
|
180
|
+
params: {
|
|
181
|
+
"booga2.xxx": "yyy",
|
|
182
|
+
"javax.faces.behavior.event": "change",
|
|
183
|
+
"booga": "bla"
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
} catch (err) {
|
|
187
|
+
console.error(err);
|
|
188
|
+
expect(false).to.eq(true);
|
|
189
|
+
}
|
|
190
|
+
const requestBody = this.requests[0].requestBody;
|
|
191
|
+
//We check if the base64 encoded string matches the original
|
|
192
|
+
expect(requestBody.indexOf("javax.faces.behavior.event")).to.not.eq(-1);
|
|
193
|
+
expect(requestBody.indexOf("javax.faces.behavior.event=change")).to.not.eq(-1);
|
|
194
|
+
expect(requestBody.indexOf("page%3Ainput=input_value")).to.not.eq(-1);
|
|
195
|
+
done();
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* This test is based on Tobago 6 (Jakarte EE 9).
|
|
203
|
+
*/
|
|
204
|
+
it("must handle ':' in IDs properly", function (done) {
|
|
205
|
+
window.document.body.innerHTML = `
|
|
206
|
+
|
|
207
|
+
<tobago-page locale="en" class="container-fluid" id="page" focus-on-error="true" wait-overlay-delay-full="1000" wait-overlay-delay-ajax="1000">
|
|
208
|
+
<form action="/content/010-input/10-in/In.xhtml?jfwid=q6qbeuqed" id="page::form" method="post" accept-charset="UTF-8" data-tobago-context-path="">
|
|
209
|
+
<input type="hidden" name="jakarta.faces.source" id="jakarta.faces.source" disabled="disabled">
|
|
210
|
+
<tobago-focus id="page::lastFocusId">
|
|
211
|
+
<input type="hidden" name="page::lastFocusId" id="page::lastFocusId::field">
|
|
212
|
+
</tobago-focus>
|
|
213
|
+
<input type="hidden" name="org.apache.myfaces.tobago.webapp.Secret" id="org.apache.myfaces.tobago.webapp.Secret" value="secretValue">
|
|
214
|
+
<tobago-in id="page:input" class="tobago-auto-spacing">
|
|
215
|
+
<input type="text" name="page:input" id="page:input::field" class="form-control" value="Bob">
|
|
216
|
+
<tobago-behavior event="change" client-id="page:input" field-id="page:input::field" execute="page:input" render="page:output"></tobago-behavior>
|
|
217
|
+
</tobago-in>
|
|
218
|
+
<tobago-out id="page:output" class="tobago-auto-spacing">
|
|
219
|
+
<span class="form-control-plaintext"></span>
|
|
220
|
+
</tobago-out>
|
|
221
|
+
<div class="tobago-page-menuStore">
|
|
222
|
+
</div>
|
|
223
|
+
<span id="page::faces-state-container">
|
|
224
|
+
<input type="hidden" name="jakarta.faces.ViewState" id="j_id__v_0:jakarta.faces.ViewState:1" value="viewStateValue" autocomplete="off">
|
|
225
|
+
<input type="hidden" name="jakarta.faces.RenderKitId" value="tobago">
|
|
226
|
+
<input type="hidden" id="j_id__v_0:jakarta.faces.ClientWindow:1" name="jakarta.faces.ClientWindow" value="clientWindowValue">
|
|
227
|
+
</span>
|
|
228
|
+
</form>
|
|
229
|
+
</tobago-page>
|
|
230
|
+
`;
|
|
231
|
+
|
|
232
|
+
//we now run the tests here
|
|
233
|
+
try {
|
|
234
|
+
|
|
235
|
+
let event = {
|
|
236
|
+
isTrusted: true,
|
|
237
|
+
type: 'change',
|
|
238
|
+
target: document.getElementById("page:input::field"),
|
|
239
|
+
currentTarget: document.getElementById("page:input::field")
|
|
240
|
+
};
|
|
241
|
+
global.debug2 = true;
|
|
242
|
+
faces.ajax.request(document.getElementById("page:input"), event as any, {
|
|
243
|
+
"jakarta.faces.behavior.event": 'change',
|
|
244
|
+
execute: "page:input",
|
|
245
|
+
render: "page:output"
|
|
246
|
+
});
|
|
247
|
+
} catch (err) {
|
|
248
|
+
console.error(err);
|
|
249
|
+
expect(false).to.eq(true);
|
|
250
|
+
}
|
|
251
|
+
const requestBody = this.requests[0].requestBody;
|
|
252
|
+
expect(requestBody.indexOf("org.apache.myfaces.tobago.webapp.Secret=secretValue")).to.not.eq(-1);
|
|
253
|
+
expect(requestBody.indexOf("page%3Ainput=Bob")).to.not.eq(-1);
|
|
254
|
+
expect(requestBody.indexOf("jakarta.faces.ViewState=viewStateValue")).to.not.eq(-1);
|
|
255
|
+
expect(requestBody.indexOf("jakarta.faces.RenderKitId=tobago")).to.not.eq(-1);
|
|
256
|
+
expect(requestBody.indexOf("jakarta.faces.ClientWindow=clientWindowValue")).to.not.eq(-1);
|
|
257
|
+
expect(requestBody.indexOf("jakarta.faces.behavior.event=change")).to.not.eq(-1);
|
|
258
|
+
expect(requestBody.indexOf("jakarta.faces.partial.event=change")).to.not.eq(-1);
|
|
259
|
+
expect(requestBody.indexOf("jakarta.faces.source=page%3Ainput")).to.not.eq(-1);
|
|
260
|
+
expect(requestBody.indexOf("jakarta.faces.partial.ajax=true")).to.not.eq(-1);
|
|
261
|
+
expect(requestBody.indexOf("page%3A%3Aform=page%3A%3Aform")).to.not.eq(-1);
|
|
262
|
+
expect(requestBody.indexOf("jakarta.faces.partial.execute=page%3Ainput")).to.not.eq(-1);
|
|
263
|
+
expect(requestBody.indexOf("jakarta.faces.partial.render=page%3Aoutput")).to.not.eq(-1);
|
|
264
|
+
done();
|
|
265
|
+
});
|
|
266
|
+
|
|
126
267
|
});
|