jsf.js_next_gen 1.0.0-beta-19 → 4.0.0-RC-1
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/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +81 -24
- package/dist/docs/assets/highlight.css +21 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +34 -2
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
- package/dist/docs/functions/myfaces.ab.html +10 -8
- package/dist/docs/index.html +74 -29
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
- package/dist/docs/modules/faces.html +75 -0
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
- package/dist/docs/modules/myfaces.html +8 -6
- package/dist/docs/modules.html +9 -7
- package/dist/docs/variables/faces.contextpath.html +57 -0
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
- package/dist/docs/variables/faces.specversion.html +64 -0
- package/dist/docs/variables/myfaces.oam.html +8 -6
- package/dist/window/faces-development.js +7688 -0
- 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 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +87 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +3043 -3018
- 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 +2 -1
- package/dist/window/jsf.js.LICENSE.txt +87 -0
- 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 +12 -12
- package/pom.xml +14 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
- package/src/main/typescript/@types/definitions/index.d.ts +147 -0
- package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
- package/src/main/typescript/api/faces.ts +44 -0
- package/src/main/typescript/api/jsf.ts +43 -0
- package/src/main/typescript/impl/AjaxImpl.ts +39 -42
- package/src/main/typescript/impl/PushImpl.ts +27 -30
- package/src/main/typescript/impl/core/Const.ts +38 -16
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +3 -3
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
- package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
- package/src/main/typescript/myfaces/OamSubmit.ts +51 -86
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -6
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +78 -33
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -7
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +99 -17
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
- package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
- package/src/main/typescript/tsconfig-typedoc.json +17 -1
- package/src/main/typescript/tsconfig.json +24 -5
- package/src/test/resources/jsf-development.js +1 -1
- package/src/test.html +75 -0
- package/src/tmp/test.html +92 -0
- package/target/api/{Jsf.js → _api.js} +68 -70
- package/target/api/_api.js.map +1 -0
- package/target/api/faces.js +45 -0
- package/target/api/faces.js.map +1 -0
- package/target/api/jsf.js +45 -0
- package/target/api/jsf.js.map +1 -0
- 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 +85 -93
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +63 -64
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +38 -19
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +10 -15
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +5 -6
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +12 -21
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +235 -138
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +43 -50
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +37 -62
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +12 -14
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +27 -29
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +40 -36
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +165 -167
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +75 -103
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +160 -145
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
- package/target/myfaces/OamSubmit.js +63 -74
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -111
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -37
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +300 -121
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +68 -33
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +133 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +45 -21
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +90 -18
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +24 -30
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +63 -71
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +70 -83
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +15 -17
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +73 -91
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +72 -98
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +107 -120
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
- package/target/test/xhrCore/ResponseTest.spec.js +206 -105
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
- package/target/test/xhrCore/ShadowDomTest.spec.js +56 -66
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +87 -97
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +65 -16
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/jsf-development.js +452 -3674
- package/target/test-classes/jsf.js +1 -1
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/webpack.config.js +7 -4
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +23 -4
- package/dist/docs/modules/jsf.html +0 -71
- package/dist/docs/variables/jsf.specversion.html +0 -52
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
- package/src/main/types/typedefs.d.ts +0 -66
- package/target/api/Jsf.js.map +0 -1
- package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
- package/target/impl/util/ListenerQueue.js +0 -3
- package/target/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/api/Jsf.js +0 -258
- package/target/main/typescript/api/Jsf.js.map +0 -1
- package/target/main/typescript/impl/AjaxImpl.js +0 -569
- package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/main/typescript/impl/PushImpl.js +0 -215
- package/target/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/main/typescript/impl/core/Const.js +0 -135
- package/target/main/typescript/impl/core/Const.js.map +0 -1
- package/target/main/typescript/impl/core/ImplTypes.js +0 -43
- package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/main/typescript/impl/i18n/Messages.js +0 -114
- package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/main/typescript/impl/util/Assertions.js +0 -90
- package/target/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
- package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/main/typescript/impl/util/Lang.js +0 -215
- package/target/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
- package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
- package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/Response.js +0 -167
- package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/LangTest.js +0 -112
- package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/typescript/impl/ImplTest.js +0 -98
- package/target/test/typescript/impl/ImplTest.js.map +0 -1
- package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
- package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
- package/target/test/typescript/xhrCore/EventTests.js +0 -155
- package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
- package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
- package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
- package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -15,22 +15,20 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {describe, it} from "mocha";
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
21
|
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
|
+
import {oam} from "../../myfaces/OamSubmit";
|
|
23
|
+
import setHiddenInput = oam.setHiddenInput;
|
|
24
|
+
import {DomQuery} from "mona-dish";
|
|
25
|
+
import clearHiddenInput = oam.clearHiddenInput;
|
|
26
|
+
import submitForm = oam.submitForm;
|
|
27
|
+
import Sinon from "sinon";
|
|
22
28
|
|
|
23
|
-
declare var jsf: any;
|
|
24
|
-
declare var Implementation: any;
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
execute: "input_1",
|
|
29
|
-
render: "@form",
|
|
30
|
-
pass1: "pass1",
|
|
31
|
-
pass2: "pass2"
|
|
32
|
-
});
|
|
33
|
-
};
|
|
30
|
+
declare var myfaces: any;
|
|
31
|
+
|
|
34
32
|
/**
|
|
35
33
|
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
36
34
|
*/
|
|
@@ -38,13 +36,97 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
38
36
|
|
|
39
37
|
beforeEach(() => {
|
|
40
38
|
return defaultMyFaces();
|
|
41
|
-
})
|
|
39
|
+
})
|
|
42
40
|
|
|
43
41
|
it('namespace must exist', function() {
|
|
44
|
-
expect(!!
|
|
45
|
-
expect(!!
|
|
46
|
-
expect(!!
|
|
47
|
-
expect(!!
|
|
42
|
+
expect(!!myfaces?.oam).to.eq(true);
|
|
43
|
+
expect(!!myfaces?.oam?.setHiddenInput).to.eq(true);
|
|
44
|
+
expect(!!myfaces?.oam?.clearHiddenInput).to.eq(true);
|
|
45
|
+
expect(!!myfaces?.oam?.submitForm).to.eq(true);
|
|
48
46
|
});
|
|
47
|
+
|
|
48
|
+
it('hidden input setting must work', function() {
|
|
49
|
+
let FORM_ID = "blarg";
|
|
50
|
+
setHiddenInput(FORM_ID, "new_hidden", "hiddenvalue");
|
|
51
|
+
expect(DomQuery.byId(FORM_ID).querySelectorAll("input[name='new_hidden']").isPresent());
|
|
52
|
+
expect(DomQuery.byId(FORM_ID).querySelectorAll("input[name='new_hidden']").inputValue.value).to.eq("hiddenvalue");
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('resetting the hidden input must work', function() {
|
|
56
|
+
let FORM_ID = "blarg";
|
|
57
|
+
setHiddenInput(FORM_ID, "new_hidden", "hiddenvalue");
|
|
58
|
+
clearHiddenInput(FORM_ID, "new_hidden");
|
|
59
|
+
expect(DomQuery.byId(FORM_ID).querySelectorAll("input[name='new_hidden']").isAbsent()).to.eq(true);
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it('submit form must work', function() {
|
|
63
|
+
let FORM_ID = "blarg";
|
|
64
|
+
let form = DomQuery.byId(FORM_ID);
|
|
65
|
+
const submit_spy = Sinon.spy(() => {
|
|
66
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').isPresent()).to.eq(true);
|
|
67
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').length == 1).to.eq(true);
|
|
68
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').inputValue.value == 'val_booga1').to.eq(true);
|
|
69
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').isPresent()).to.eq(true);
|
|
70
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').length == 1).to.eq(true);
|
|
71
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').inputValue.value == 'val_booga2').to.eq(true);
|
|
72
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isPresent()).to.eq(true);
|
|
73
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).length == 1).to.eq(true);
|
|
74
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).inputValue.value == 'mylink').to.eq(true);
|
|
75
|
+
expect(form.attr("target").value).to.eq('target1');
|
|
76
|
+
});
|
|
77
|
+
(form.value.value as any).submit = submit_spy;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
submitForm(FORM_ID, 'mylink', 'target1', {
|
|
81
|
+
booga1: "val_booga1",
|
|
82
|
+
booga2: "val_booga2"
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
expect(submit_spy.called).to.eq(true);
|
|
86
|
+
form = DomQuery.byId(FORM_ID);
|
|
87
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').isAbsent()).to.eq(true);
|
|
88
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').isAbsent()).to.eq(true);
|
|
89
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isAbsent()).to.eq(true);
|
|
90
|
+
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it('onsubmit form must work', function() {
|
|
94
|
+
let FORM_ID = "blarg";
|
|
95
|
+
let form = DomQuery.byId(FORM_ID);
|
|
96
|
+
const onsumbit = () => {
|
|
97
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').isPresent()).to.eq(true);
|
|
98
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').length == 1).to.eq(true);
|
|
99
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').inputValue.value == 'val_booga1').to.eq(true);
|
|
100
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').isPresent()).to.eq(true);
|
|
101
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').length == 1).to.eq(true);
|
|
102
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').inputValue.value == 'val_booga2').to.eq(true);
|
|
103
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isPresent()).to.eq(true);
|
|
104
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).length == 1).to.eq(true);
|
|
105
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).inputValue.value == 'mylink').to.eq(true);
|
|
106
|
+
expect(form.attr("target").value).to.eq('target1');
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const os_spy = Sinon.spy(onsumbit);
|
|
110
|
+
const submit_spy = Sinon.spy(() => {});
|
|
111
|
+
(form.value.value as any).onsubmit = os_spy;
|
|
112
|
+
(form.value.value as any).submit = submit_spy;
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
submitForm(FORM_ID, 'mylink', 'target1', {
|
|
116
|
+
booga1: "val_booga1",
|
|
117
|
+
booga2: "val_booga2"
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
//we also have to interceot onsbumit
|
|
121
|
+
expect(os_spy.called).to.eq(true);
|
|
122
|
+
expect(submit_spy.called).to.eq(false);
|
|
123
|
+
|
|
124
|
+
form = DomQuery.byId(FORM_ID);
|
|
125
|
+
expect(form.querySelectorAll('input[name=\'booga1\']').isAbsent()).to.eq(true);
|
|
126
|
+
expect(form.querySelectorAll('input[name=\'booga2\']').isAbsent()).to.eq(true);
|
|
127
|
+
expect(form.querySelectorAll(`input[name='${FORM_ID}:_idcl']`).isAbsent()).to.eq(true);
|
|
128
|
+
// expect(submit_spy.called).to.eq(true);
|
|
129
|
+
})
|
|
130
|
+
|
|
49
131
|
// further tests will follow if needed, for now the namespace must be restored
|
|
50
132
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -38,12 +38,12 @@ describe('Asynchronous Queue tests', () => {
|
|
|
38
38
|
this.requests.push(xhr);
|
|
39
39
|
};
|
|
40
40
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
41
|
-
|
|
41
|
+
window.XMLHttpRequest = this.xhr;
|
|
42
42
|
|
|
43
|
-
this.jsfAjaxResponse = sinon.stub((<any>global).
|
|
43
|
+
this.jsfAjaxResponse = sinon.stub((<any>global).faces.ajax, "response");
|
|
44
44
|
|
|
45
45
|
this.closeIt = () => {
|
|
46
|
-
(<any>global).XMLHttpRequest =
|
|
46
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
47
47
|
this.jsfAjaxResponse.restore();
|
|
48
48
|
Implementation.reset();
|
|
49
49
|
close();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -24,10 +24,11 @@ import protocolPage = StandardInits.protocolPage;
|
|
|
24
24
|
import {DQ} from "mona-dish";
|
|
25
25
|
import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
|
|
26
26
|
|
|
27
|
-
declare var
|
|
27
|
+
declare var faces: any;
|
|
28
28
|
|
|
29
29
|
describe('tests the addOnEvent and addOnError handling', function () {
|
|
30
30
|
|
|
31
|
+
// noinspection DuplicatedCode
|
|
31
32
|
beforeEach(async function () {
|
|
32
33
|
let waitForResult = protocolPage();
|
|
33
34
|
return waitForResult.then((close) => {
|
|
@@ -36,7 +37,7 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
36
37
|
this.requests = [];
|
|
37
38
|
|
|
38
39
|
this.respond = (response: string): XMLHttpRequest => {
|
|
39
|
-
let xhrReq = this.requests.shift();
|
|
40
|
+
let xhrReq = (this.requests as Array<any>).shift();
|
|
40
41
|
xhrReq.responsetype = "text/xml";
|
|
41
42
|
xhrReq.respond(200, {'Content-Type': 'text/xml'}, response);
|
|
42
43
|
return xhrReq;
|
|
@@ -46,10 +47,10 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
46
47
|
this.requests.push(xhr);
|
|
47
48
|
};
|
|
48
49
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
49
|
-
|
|
50
|
+
window.XMLHttpRequest = this.xhr;
|
|
50
51
|
|
|
51
52
|
this.closeIt = () => {
|
|
52
|
-
(<any>global).XMLHttpRequest =
|
|
53
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
53
54
|
Implementation.reset();
|
|
54
55
|
close();
|
|
55
56
|
}
|
|
@@ -59,18 +60,11 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
59
60
|
afterEach(function () {
|
|
60
61
|
this.closeIt();
|
|
61
62
|
});
|
|
62
|
-
|
|
63
|
-
let allowedStati = {
|
|
64
|
-
"begin": true,
|
|
65
|
-
"complete": true,
|
|
66
|
-
"success": true,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
63
|
it("must have a global add on event call with all three phases passed", function () {
|
|
70
64
|
let onEventCalled1 = 0;
|
|
71
65
|
let onEventCalled2 = 0;
|
|
72
66
|
|
|
73
|
-
|
|
67
|
+
faces.ajax.addOnEvent((data: any) => {
|
|
74
68
|
onEventCalled1++;
|
|
75
69
|
if (onEventCalled1 == 1 && data.status != "begin") {
|
|
76
70
|
throw ("Wrong status")
|
|
@@ -82,11 +76,10 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
82
76
|
throw ("Wrong status")
|
|
83
77
|
}
|
|
84
78
|
});
|
|
85
|
-
|
|
79
|
+
faces.ajax.addOnEvent(() => {
|
|
86
80
|
onEventCalled2++;
|
|
87
|
-
|
|
88
81
|
});
|
|
89
|
-
|
|
82
|
+
DQ.byId("cmd_update_insert").click();
|
|
90
83
|
this.respond(XmlResponses.UPDATE_INSERT_1);
|
|
91
84
|
|
|
92
85
|
expect(onEventCalled1).to.eq(3);
|
|
@@ -99,17 +92,17 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
99
92
|
|
|
100
93
|
let errorTitle = '';
|
|
101
94
|
let errorMessage = '';
|
|
102
|
-
|
|
95
|
+
faces.ajax.addOnError((data: any) => {
|
|
103
96
|
errorTitle = data.errorName;
|
|
104
97
|
errorMessage = data.errorMessage;
|
|
105
98
|
onErrorCalled1++
|
|
106
99
|
});
|
|
107
|
-
|
|
100
|
+
faces.ajax.addOnError(() => {
|
|
108
101
|
onErrorCalled2++;
|
|
109
102
|
});
|
|
110
103
|
|
|
111
104
|
//cmd_error_component
|
|
112
|
-
|
|
105
|
+
DQ.byId("cmd_error_component").click();
|
|
113
106
|
this.respond(XmlResponses.ERROR_2);
|
|
114
107
|
|
|
115
108
|
expect(onErrorCalled1).to.eq(1);
|
|
@@ -119,21 +112,20 @@ describe('tests the addOnEvent and addOnError handling', function () {
|
|
|
119
112
|
});
|
|
120
113
|
|
|
121
114
|
it("must have an id set if there is an emitting element", function () {
|
|
122
|
-
let onEventCalled1 = 0;
|
|
123
115
|
let onEventCalled2 = 0;
|
|
124
116
|
|
|
125
117
|
let assertSourceExists = (data: any) => {
|
|
126
118
|
expect(!!data?.source?.id).to.be.true;
|
|
127
119
|
}
|
|
128
120
|
|
|
129
|
-
|
|
121
|
+
faces.ajax.addOnEvent((data: any) => {
|
|
130
122
|
assertSourceExists(data);
|
|
131
123
|
});
|
|
132
|
-
|
|
124
|
+
faces.ajax.addOnEvent(() => {
|
|
133
125
|
onEventCalled2++;
|
|
134
126
|
|
|
135
127
|
});
|
|
136
|
-
|
|
128
|
+
DQ.byId("cmd_update_insert").click();
|
|
137
129
|
this.respond(XmlResponses.UPDATE_INSERT_1);
|
|
138
130
|
|
|
139
131
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -19,14 +19,14 @@ export class FakeWebsocket {
|
|
|
19
19
|
onmessage: Function = () => {}
|
|
20
20
|
onclose: Function = () => {}
|
|
21
21
|
|
|
22
|
-
constructor(
|
|
22
|
+
constructor() {
|
|
23
23
|
setTimeout(() => {
|
|
24
24
|
this.onopen();
|
|
25
25
|
}, 10);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
send(
|
|
29
|
+
send() {
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
_respond(response: any) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -18,33 +18,10 @@ import * as sinon from "sinon";
|
|
|
18
18
|
import {expect} from "chai";
|
|
19
19
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
20
20
|
import {DomQuery} from "mona-dish";
|
|
21
|
-
import {
|
|
22
|
-
COMPLETE,
|
|
23
|
-
P_AJAX,
|
|
24
|
-
P_EXECUTE,
|
|
25
|
-
P_PARTIAL_SOURCE,
|
|
26
|
-
P_RENDER,
|
|
27
|
-
P_VIEWSTATE,
|
|
28
|
-
P_WINDOW_ID,
|
|
29
|
-
SUCCESS
|
|
30
|
-
} from "../../impl/core/Const";
|
|
31
|
-
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
32
|
-
import STD_XML = StandardInits.STD_XML;
|
|
33
21
|
import defaultFileForm = StandardInits.defaultFileForm;
|
|
34
22
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
35
23
|
|
|
36
|
-
declare var
|
|
37
|
-
declare var Impl
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
let issueStdReq = function (element) {
|
|
41
|
-
jsf.ajax.request(element, null, {
|
|
42
|
-
execute: "input_1",
|
|
43
|
-
render: "@form",
|
|
44
|
-
pass1: "pass1",
|
|
45
|
-
pass2: "pass2"
|
|
46
|
-
});
|
|
47
|
-
};
|
|
24
|
+
declare var faces: any;
|
|
48
25
|
|
|
49
26
|
/**
|
|
50
27
|
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
@@ -69,10 +46,10 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
69
46
|
this.requests.push(xhr);
|
|
70
47
|
};
|
|
71
48
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
72
|
-
|
|
49
|
+
window.XMLHttpRequest = this.xhr;
|
|
73
50
|
|
|
74
51
|
this.closeIt = () => {
|
|
75
|
-
(<any>global).XMLHttpRequest =
|
|
52
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
76
53
|
Implementation.reset();
|
|
77
54
|
close();
|
|
78
55
|
}
|
|
@@ -87,7 +64,6 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
87
64
|
it('must have sent a form multipart request', function (done) {
|
|
88
65
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
89
66
|
const CONTENT_TYPE = "Content-Type";
|
|
90
|
-
const MULTIPART_FORM = "multipart/form-data";
|
|
91
67
|
const POST = "POST";
|
|
92
68
|
|
|
93
69
|
try {
|
|
@@ -95,7 +71,7 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
95
71
|
let button = DomQuery.byId("input_1");
|
|
96
72
|
|
|
97
73
|
button.addEventListener("click", (event: Event) => {
|
|
98
|
-
|
|
74
|
+
faces.ajax.request(event.target, event, {render: '@all', execute: '@form'})
|
|
99
75
|
}).click();
|
|
100
76
|
//this.resonse("ok");
|
|
101
77
|
|
|
@@ -119,14 +95,13 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
119
95
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
120
96
|
|
|
121
97
|
const CONTENT_TYPE = "Content-Type";
|
|
122
|
-
const MULTIPART_FORM = "multipart/form-data";
|
|
123
98
|
const POST = "POST";
|
|
124
99
|
|
|
125
100
|
try {
|
|
126
101
|
let button = DomQuery.byId("input_1");
|
|
127
102
|
|
|
128
103
|
button.addEventListener("click", (event: Event) => {
|
|
129
|
-
|
|
104
|
+
faces.ajax.request(event.target, event, {render: '@all', execute: 'input_1 fíleupload'})
|
|
130
105
|
}).click();
|
|
131
106
|
//this.resonse("ok");
|
|
132
107
|
|
|
@@ -157,7 +132,7 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
157
132
|
let button = DomQuery.byId("input_1");
|
|
158
133
|
|
|
159
134
|
button.addEventListener("click", (event: Event) => {
|
|
160
|
-
|
|
135
|
+
faces.ajax.request(event.target, event, {render: '@all', execute: 'input_1 fileupload'});
|
|
161
136
|
}).click();
|
|
162
137
|
|
|
163
138
|
expect(this.requests.length).to.eq(1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -16,43 +16,22 @@
|
|
|
16
16
|
import * as sinon from "sinon";
|
|
17
17
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
18
18
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
import protocolPage = StandardInits.protocolPage;
|
|
21
21
|
import {DQ} from "mona-dish";
|
|
22
22
|
import {XhrFormData} from "../../impl/xhrCore/XhrFormData";
|
|
23
23
|
import { expect } from "chai";
|
|
24
24
|
|
|
25
25
|
describe("test for proper request param patterns identical to the old implementation", function () {
|
|
26
|
-
const DELETE_PATTERN = {
|
|
27
|
-
op: "delete1",
|
|
28
|
-
"javax.faces.source": "cmd_delete",
|
|
29
|
-
"javax.faces.partial.event": "click",
|
|
30
|
-
"javax.faces.partial.ajax": "true",
|
|
31
|
-
"javax.faces.partial.execute": "cmd_delete",
|
|
32
|
-
"form1": "form1",
|
|
33
|
-
"javax.faces.ViewState": "blubbblubblubb"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
26
|
const UPDATE_INSERT_2 = {
|
|
37
27
|
"op": "updateinsert2",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
28
|
+
"jakarta.faces.partial.event": "click",
|
|
29
|
+
"jakarta.faces.source": "cmd_update_insert2",
|
|
30
|
+
"jakarta.faces.partial.ajax": "true",
|
|
31
|
+
"jakarta.faces.partial.execute": "cmd_update_insert2",
|
|
42
32
|
"form1": "form1",
|
|
43
|
-
"
|
|
33
|
+
"jakarta.faces.ViewState": "blubbblubblubb"
|
|
44
34
|
}
|
|
45
|
-
|
|
46
|
-
const ERRORS = {
|
|
47
|
-
"op": "errors",
|
|
48
|
-
"javax.faces.partial.event": "click",
|
|
49
|
-
"javax.faces.source": "cmd_error",
|
|
50
|
-
"javax.faces.partial.ajax": "true",
|
|
51
|
-
"javax.faces.partial.execute": "cmd_error",
|
|
52
|
-
"form1": "form1",
|
|
53
|
-
"javax.faces.ViewState": "blubbblubblubb"
|
|
54
|
-
}
|
|
55
|
-
|
|
56
35
|
/**
|
|
57
36
|
* matches two maps for absolute identicality
|
|
58
37
|
*/
|
|
@@ -81,12 +60,12 @@ describe("test for proper request param patterns identical to the old implementa
|
|
|
81
60
|
this.requests.push(xhr);
|
|
82
61
|
};
|
|
83
62
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
84
|
-
|
|
63
|
+
window.XMLHttpRequest = this.xhr;
|
|
85
64
|
|
|
86
|
-
this.jsfAjaxResponse = sinon.stub((<any>global).
|
|
65
|
+
this.jsfAjaxResponse = sinon.stub((<any>global).faces.ajax, "response");
|
|
87
66
|
|
|
88
67
|
this.closeIt = () => {
|
|
89
|
-
(<any>global).XMLHttpRequest =
|
|
68
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
90
69
|
this.jsfAjaxResponse.restore();
|
|
91
70
|
Implementation.reset();
|
|
92
71
|
close();
|
|
@@ -111,37 +90,37 @@ describe("test for proper request param patterns identical to the old implementa
|
|
|
111
90
|
|
|
112
91
|
it("must handle base64 encoded strings properly as request data", function() {
|
|
113
92
|
let probe = "YWFhYWFhc1Rlc3RpdCDDpGtvNDU5NjczMDA9PSsrNDU5MGV3b3UkJiUmLyQmJQ==";
|
|
114
|
-
DQ.byId("
|
|
93
|
+
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
115
94
|
DQ.byId("cmd_update_insert2").click();
|
|
116
95
|
let requestBody = this.requests[0].requestBody;
|
|
117
96
|
//We check if the base64 encoded string matches the original
|
|
118
97
|
let formData = new XhrFormData(requestBody);
|
|
119
98
|
|
|
120
|
-
expect(decodeURIComponent(formData.getIf("
|
|
99
|
+
expect(decodeURIComponent(formData.getIf("jakarta.faces.ViewState").value) == probe).to.be.true;
|
|
121
100
|
});
|
|
122
101
|
|
|
123
102
|
|
|
124
103
|
it("must handle empty parameters properly", function() {
|
|
125
104
|
let probe = "";
|
|
126
|
-
DQ.byId("
|
|
105
|
+
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
127
106
|
DQ.byId("cmd_update_insert2").click();
|
|
128
107
|
let requestBody = this.requests[0].requestBody;
|
|
129
108
|
//We check if the base64 encoded string matches the original
|
|
130
109
|
let formData = new XhrFormData(requestBody);
|
|
131
110
|
|
|
132
|
-
expect(decodeURIComponent(formData.getIf("
|
|
111
|
+
expect(decodeURIComponent(formData.getIf("jakarta.faces.ViewState").value) == probe).to.be.true;
|
|
133
112
|
});
|
|
134
113
|
|
|
135
114
|
//KssbpZfCe+0lwDhgMRQ44wRFkaM1o1lbMMUO3lini5YhXWm6
|
|
136
115
|
|
|
137
116
|
it("must handle base64 special cases properly (+ in encoding)", function() {
|
|
138
117
|
let probe = "KssbpZfCe+0lwDhgMRQ44wRFkaM1o1lbMMUO3lini5YhXWm6";
|
|
139
|
-
DQ.byId("
|
|
118
|
+
DQ.byId("jakarta.faces.ViewState").inputValue.value = probe;
|
|
140
119
|
DQ.byId("cmd_update_insert2").click();
|
|
141
120
|
let requestBody = this.requests[0].requestBody;
|
|
142
121
|
//We check if the base64 encoded string matches the original
|
|
143
122
|
let formData = new XhrFormData(requestBody);
|
|
144
123
|
|
|
145
|
-
expect(decodeURIComponent(formData.getIf("
|
|
124
|
+
expect(decodeURIComponent(formData.getIf("jakarta.faces.ViewState").value) == probe).to.be.true;
|
|
146
125
|
});
|
|
147
126
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
33
33
|
import STD_XML = StandardInits.STD_XML;
|
|
34
34
|
|
|
35
|
-
declare var
|
|
35
|
+
declare var faces: any;
|
|
36
36
|
declare var Implementation: any;
|
|
37
37
|
|
|
38
38
|
let issueStdReq = function (element) {
|
|
39
|
-
|
|
39
|
+
faces.ajax.request(element, null, {
|
|
40
40
|
execute: "input_1",
|
|
41
41
|
render: "@form",
|
|
42
42
|
pass1: "pass1",
|
|
@@ -60,12 +60,12 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
60
60
|
this.requests.push(xhr);
|
|
61
61
|
};
|
|
62
62
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
63
|
-
|
|
63
|
+
window.XMLHttpRequest = this.xhr;
|
|
64
64
|
|
|
65
|
-
this.jsfAjaxResponse = sinon.spy((<any>global).
|
|
65
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
66
66
|
|
|
67
67
|
this.closeIt = () => {
|
|
68
|
-
(<any>global).XMLHttpRequest =
|
|
68
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
69
69
|
this.jsfAjaxResponse.restore();
|
|
70
70
|
Implementation.reset();
|
|
71
71
|
close();
|
|
@@ -78,7 +78,7 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('must have the standard parameters all in', function (done) {
|
|
81
|
-
//issue a standard
|
|
81
|
+
//issue a standard faces.ajax.request upon the standard simple form case and check the passed parameters
|
|
82
82
|
//and whether send was called
|
|
83
83
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
84
84
|
|
|
@@ -92,7 +92,7 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
92
92
|
expect(send.called).to.be.true;
|
|
93
93
|
expect(send.callCount).to.eq(1);
|
|
94
94
|
|
|
95
|
-
//sent params
|
|
95
|
+
//sent params jakarta.faces.ViewState=null&execute=input_1&render=%40form&pass1=pass1&pass2=pass2&jakarta.faces.windowId=null&jakarta.faces.source=input_2&jakarta.faces.partial.ajax=input_2&blarg=blarg&jakarta.faces.partial.execute=input_1%20input_2&jakarta.faces.partial.render=blarg
|
|
96
96
|
|
|
97
97
|
} finally {
|
|
98
98
|
|
|
@@ -165,12 +165,13 @@ describe('Tests after core when it hits response', function () {
|
|
|
165
165
|
this.requests.push(xhr);
|
|
166
166
|
};
|
|
167
167
|
(<any>global).XMLHttpRequest = this.xhr = sinon.useFakeXMLHttpRequest();
|
|
168
|
-
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
window.XMLHttpRequest = this.xhr = sinon.useFakeXMLHttpRequest() as XMLHttpRequest;
|
|
169
170
|
|
|
170
|
-
this.jsfAjaxResponse = sinon.spy((<any>global).
|
|
171
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
171
172
|
|
|
172
173
|
this.closeIt = () => {
|
|
173
|
-
(<any>global).XMLHttpRequest =
|
|
174
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
174
175
|
this.jsfAjaxResponse.restore();
|
|
175
176
|
Implementation.reset();
|
|
176
177
|
close();
|
|
@@ -189,10 +190,10 @@ describe('Tests after core when it hits response', function () {
|
|
|
189
190
|
let localCnt = 0;
|
|
190
191
|
try {
|
|
191
192
|
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
192
|
-
|
|
193
|
+
faces.ajax.addOnEvent(() => {
|
|
193
194
|
globalCnt++;
|
|
194
195
|
});
|
|
195
|
-
|
|
196
|
+
faces.ajax.request(element, null, {
|
|
196
197
|
execute: "input_1",
|
|
197
198
|
render: "@form",
|
|
198
199
|
pass1: "pass1",
|
|
@@ -227,12 +228,12 @@ describe('Tests after core when it hits response', function () {
|
|
|
227
228
|
|
|
228
229
|
try {
|
|
229
230
|
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
230
|
-
|
|
231
|
+
faces.ajax.addOnEvent(() => {
|
|
231
232
|
globalCnt++;
|
|
232
233
|
});
|
|
233
234
|
|
|
234
235
|
|
|
235
|
-
|
|
236
|
+
faces.ajax.request(element, null, {
|
|
236
237
|
execute: "input_1",
|
|
237
238
|
render: "@form",
|
|
238
239
|
pass1: "pass1",
|
|
@@ -292,7 +293,7 @@ describe('Tests after core when it hits response', function () {
|
|
|
292
293
|
try {
|
|
293
294
|
let errorCnt = 0;
|
|
294
295
|
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
295
|
-
|
|
296
|
+
faces.ajax.request(element, null, {
|
|
296
297
|
execute: "input_1",
|
|
297
298
|
render: "@form",
|
|
298
299
|
pass1: "pass1",
|