jsf.js_next_gen 4.1.0-beta.2 → 4.1.0-beta.21
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/AI_CONTRIBUTIONS.md +71 -0
- package/README.md +254 -78
- package/api-extractor.faces.json +38 -0
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/functions/faces.ajax.addOnError.html +2 -2
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -2
- package/dist/docs/functions/faces.ajax.request.html +2 -2
- package/dist/docs/functions/faces.ajax.response.html +2 -2
- package/dist/docs/functions/faces.getClientWindow.html +2 -2
- package/dist/docs/functions/faces.getProjectStage.html +2 -2
- package/dist/docs/functions/faces.getViewState.html +1 -1
- package/dist/docs/functions/faces.push.close.html +1 -1
- package/dist/docs/functions/faces.push.init.html +6 -6
- package/dist/docs/functions/faces.push.open.html +1 -1
- package/dist/docs/functions/faces.util.chain.html +2 -2
- package/dist/docs/functions/myfaces.ab.html +3 -3
- package/dist/docs/functions/myfaces.onDomReady.html +1 -1
- package/dist/docs/functions/myfaces.reserveNamespace.html +1 -1
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +292 -71
- package/dist/docs/interfaces/faces.AjaxData.html +6 -0
- package/dist/docs/interfaces/faces.AjaxError.html +18 -0
- package/dist/docs/interfaces/faces.AjaxEvent.html +8 -0
- package/dist/docs/interfaces/faces.ajax.RequestContext.html +6 -0
- package/dist/docs/interfaces/faces.ajax.RequestOptions.html +10 -0
- package/dist/docs/modules/faces.ajax.html +1 -1
- package/dist/docs/modules/faces.html +1 -1
- package/dist/docs/modules/faces.push.html +1 -1
- package/dist/docs/modules/faces.util.html +1 -1
- package/dist/docs/modules/myfaces.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/faces.AjaxErrorStatus.html +2 -0
- package/dist/docs/types/faces.AjaxEventStatus.html +2 -0
- package/dist/docs/types/faces.ProjectStage.html +2 -0
- package/dist/docs/types/faces.ajax.OnErrorCallback.html +2 -0
- package/dist/docs/types/faces.ajax.OnEventCallback.html +2 -0
- package/dist/docs/types/faces.push.OnCloseHandler.html +2 -0
- package/dist/docs/types/faces.push.OnErrorHandler.html +2 -0
- package/dist/docs/types/faces.push.OnMessageHandler.html +2 -0
- package/dist/docs/types/faces.push.OnOpenHandler.html +2 -0
- package/dist/docs/variables/faces.contextpath.html +1 -1
- package/dist/docs/variables/faces.implversion.html +1 -1
- package/dist/docs/variables/faces.separatorchar.html +1 -1
- package/dist/docs/variables/faces.specversion.html +1 -1
- package/dist/docs/variables/myfaces.oam.html +1 -1
- package/dist/window/faces-development.js +1801 -499
- package/dist/window/faces-development.js.map +1 -1
- package/{target/api/_api.js → dist/window/faces.d.ts} +124 -151
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.LICENSE.txt +0 -17
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +1806 -513
- package/dist/window/jsf-development.js.map +1 -1
- package/{target/src/main/typescript/api/_api.js → dist/window/jsf.d.ts} +125 -153
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.LICENSE.txt +0 -17
- package/dist/window/jsf.js.map +1 -1
- package/package.json +22 -18
- package/scripts/build-dts.mjs +239 -0
- package/src/main/typescript/@types/definitions/index.d.ts +22 -122
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test2.js → src/main/typescript/@types/definitions/modules.d.ts} +18 -2
- package/src/main/typescript/api/_api.ts +132 -29
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test.js → src/main/typescript/api/_api_ae_stub.d.ts} +6 -2
- package/src/main/typescript/api/faces.ts +2 -2
- package/src/main/typescript/api/jsf.ts +15 -23
- package/src/main/typescript/impl/AjaxImpl.ts +15 -15
- package/src/main/typescript/impl/PushImpl.ts +139 -69
- package/src/main/typescript/impl/core/Const.ts +2 -2
- package/src/main/typescript/impl/i18n/Messages.ts +1 -1
- package/src/main/typescript/impl/util/Assertions.ts +1 -2
- package/src/main/typescript/impl/util/AsyncRunnable.ts +3 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +19 -19
- package/src/main/typescript/impl/util/FileUtils.ts +30 -14
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +34 -34
- package/src/main/typescript/impl/util/Lang.ts +19 -22
- package/src/main/typescript/impl/util/XhrQueueController.ts +25 -3
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +17 -12
- package/src/main/typescript/impl/xhrCore/EventData.ts +8 -7
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +3 -3
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +7 -6
- package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
- package/src/main/typescript/impl/xhrCore/ResponseDataResolver.ts +0 -38
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +17 -15
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +72 -63
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -134
- package/src/main/typescript/mona_dish_shim.ts +6 -2
- package/src/main/typescript/myfaces/OamSubmit.ts +10 -6
- package/src/main/typescript/test/api/JsfPushShimTest.spec.ts +126 -0
- package/src/main/typescript/test/api/MyFacesABTest.spec.ts +16 -0
- package/src/main/typescript/test/api/PushTypeCompatibility.ts +65 -0
- package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +55 -9
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +16 -0
- package/src/main/typescript/test/impl/AssertionsTest.spec.ts +168 -0
- package/src/main/typescript/test/impl/FileUtilsTest.spec.ts +126 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +75 -1
- package/src/main/typescript/test/impl/ResponseDataResolverTest.spec.ts +62 -0
- package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +91 -1
- package/src/main/typescript/test/impl/util/ExtLangTest.spec.ts +110 -0
- package/src/main/typescript/test/impl/util/HiddenInputBuilderTest.spec.ts +74 -0
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +61 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +191 -2
- package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +16 -0
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +14 -0
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +21 -5
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +363 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +218 -4
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/WebsocketTest.spec.ts +764 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +265 -62
- package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +16 -0
- package/{target/src/main/typescript/test/xhrCore/FakeWebsocket.js → src/main/typescript/tsconfig.ae.json} +16 -23
- package/src/main/typescript/{tsconfig.json → tsconfig.dts.json} +11 -27
- package/src/main/typescript/tsconfig.test.json +17 -0
- package/tsconfig.api-extractor.json +17 -0
- package/.claude/settings.local.json +0 -16
- package/.github/workflows/codeql-analysis.yml +0 -83
- package/.github/workflows/nodejs.yml +0 -26
- package/.mocharc.json +0 -10
- package/.nyc_output/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/processinfo/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/processinfo/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.nycrc +0 -6
- package/build.cmd +0 -1
- package/build.sh +0 -3
- package/mvnw +0 -286
- package/mvnw.cmd +0 -161
- package/plans for 4.0.1.txt +0 -8
- package/remap.ts +0 -51
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +0 -221
- package/target/api/_api.js.map +0 -1
- package/target/api/faces.js +0 -45
- package/target/api/faces.js.map +0 -1
- package/target/api/jsf.js +0 -56
- package/target/api/jsf.js.map +0 -1
- package/target/impl/AjaxImpl.js +0 -748
- package/target/impl/AjaxImpl.js.map +0 -1
- package/target/impl/PushImpl.js +0 -265
- package/target/impl/PushImpl.js.map +0 -1
- package/target/impl/core/Const.js +0 -177
- package/target/impl/core/Const.js.map +0 -1
- package/target/impl/core/ImplTypes.js +0 -38
- package/target/impl/core/ImplTypes.js.map +0 -1
- package/target/impl/i18n/Messages.js +0 -113
- package/target/impl/i18n/Messages.js.map +0 -1
- package/target/impl/util/Assertions.js +0 -101
- package/target/impl/util/Assertions.js.map +0 -1
- package/target/impl/util/AsyncRunnable.js +0 -78
- package/target/impl/util/AsyncRunnable.js.map +0 -1
- package/target/impl/util/ExtDomQuery.js +0 -306
- package/target/impl/util/ExtDomQuery.js.map +0 -1
- package/target/impl/util/FileUtils.js +0 -98
- package/target/impl/util/FileUtils.js.map +0 -1
- package/target/impl/util/HiddenInputBuilder.js +0 -83
- package/target/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/impl/util/IListener.js +0 -3
- package/target/impl/util/IListener.js.map +0 -1
- package/target/impl/util/Lang.js +0 -263
- package/target/impl/util/Lang.js.map +0 -1
- package/target/impl/util/XhrQueueController.js +0 -92
- package/target/impl/util/XhrQueueController.js.map +0 -1
- package/target/impl/xhrCore/ErrorData.js +0 -87
- package/target/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/impl/xhrCore/EventData.js +0 -52
- package/target/impl/xhrCore/EventData.js.map +0 -1
- package/target/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/Response.js +0 -186
- package/target/impl/xhrCore/Response.js.map +0 -1
- package/target/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/XhrFormData.js +0 -163
- package/target/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/impl/xhrCore/XhrRequest.js +0 -433
- package/target/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/mona_dish_shim.js +0 -70
- package/target/mona_dish_shim.js.map +0 -1
- package/target/myfaces/OamSubmit.js +0 -128
- package/target/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/api/_api.js.map +0 -1
- package/target/src/main/typescript/api/faces.js +0 -45
- package/target/src/main/typescript/api/faces.js.map +0 -1
- package/target/src/main/typescript/api/jsf.js +0 -56
- package/target/src/main/typescript/api/jsf.js.map +0 -1
- package/target/src/main/typescript/impl/AjaxImpl.js +0 -748
- package/target/src/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/src/main/typescript/impl/PushImpl.js +0 -265
- package/target/src/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/src/main/typescript/impl/core/Const.js +0 -177
- package/target/src/main/typescript/impl/core/Const.js.map +0 -1
- package/target/src/main/typescript/impl/core/ImplTypes.js +0 -38
- package/target/src/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/src/main/typescript/impl/i18n/Messages.js +0 -113
- package/target/src/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/src/main/typescript/impl/util/Assertions.js +0 -101
- package/target/src/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/src/main/typescript/impl/util/AsyncRunnable.js +0 -78
- package/target/src/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/src/main/typescript/impl/util/ExtDomQuery.js +0 -306
- package/target/src/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/src/main/typescript/impl/util/FileUtils.js +0 -98
- package/target/src/main/typescript/impl/util/FileUtils.js.map +0 -1
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js +0 -83
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/src/main/typescript/impl/util/IListener.js +0 -3
- package/target/src/main/typescript/impl/util/IListener.js.map +0 -1
- package/target/src/main/typescript/impl/util/Lang.js +0 -263
- package/target/src/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/src/main/typescript/impl/util/XhrQueueController.js +0 -92
- package/target/src/main/typescript/impl/util/XhrQueueController.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js +0 -87
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/EventData.js +0 -52
- package/target/src/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/Response.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js +0 -163
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js +0 -433
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/src/main/typescript/mona_dish_shim.js +0 -70
- package/target/src/main/typescript/mona_dish_shim.js.map +0 -1
- package/target/src/main/typescript/myfaces/OamSubmit.js +0 -128
- package/target/src/main/typescript/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js +0 -117
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -2
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest.spec.js +0 -225
- package/target/src/main/typescript/test/impl/ImplTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js +0 -143
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js +0 -57
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js +0 -93
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js +0 -184
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js +0 -207
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/api/MyFacesABTest.spec.js +0 -117
- package/target/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test2.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +0 -16
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js.map +0 -1
- package/target/test/impl/ImplTest.spec.js +0 -225
- package/target/test/impl/ImplTest.spec.js.map +0 -1
- package/target/test/impl/ImplTest_23.spec.js +0 -143
- package/target/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/test/myfaces/OnLoad.spec.js +0 -57
- package/target/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/test/queue/AsynchronousProbe.js +0 -93
- package/target/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/test/xhrCore/EventTests.spec.js +0 -184
- package/target/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/test/xhrCore/FakeWebsocket.js +0 -38
- package/target/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/WebsocketTest.js +0 -207
- package/target/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead1.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead1.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead2.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead2.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead3.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead3.js.map +0 -1
- package/target/test/xhrCore/fixtures/nonce_script.js +0 -17
- package/target/test/xhrCore/fixtures/nonce_script.js.map +0 -1
- package/tsconfig.json +0 -9
- package/webpack.config.ts +0 -54
|
@@ -1,845 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
-
* this work for additional information regarding copyright ownership.
|
|
5
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
-
* (the "License"); you may not use this file except in compliance with
|
|
7
|
-
* the License. You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
51
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
52
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
54
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
55
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
const mocha_1 = require("mocha");
|
|
61
|
-
const sinon = __importStar(require("sinon"));
|
|
62
|
-
const chai_1 = require("chai");
|
|
63
|
-
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
64
|
-
const mona_dish_1 = require("mona-dish");
|
|
65
|
-
const Const_1 = require("../../impl/core/Const");
|
|
66
|
-
const defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
|
|
67
|
-
const initVirtualElement = StandardInits_1.StandardInits.initVirtualElement;
|
|
68
|
-
const STD_XML = StandardInits_1.StandardInits.STD_XML;
|
|
69
|
-
const initCheckboxForm = StandardInits_1.StandardInits.initCheckboxRadioForm;
|
|
70
|
-
const nise = __importStar(require("nise"));
|
|
71
|
-
let issueStdReq = function (element) {
|
|
72
|
-
faces.ajax.request(element, null, {
|
|
73
|
-
execute: "input_1",
|
|
74
|
-
render: "@form",
|
|
75
|
-
params: {
|
|
76
|
-
pass1: "pass1",
|
|
77
|
-
pass2: "pass2"
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
let issueStdPPSReq = function (element) {
|
|
82
|
-
faces.ajax.request(element, null, {
|
|
83
|
-
execute: "input_1",
|
|
84
|
-
render: "@form",
|
|
85
|
-
/*
|
|
86
|
-
* myfaces is the extension placeholder, atm only pps is used
|
|
87
|
-
* which was the most useful extension in our legacy codebase
|
|
88
|
-
*/
|
|
89
|
-
myfaces: {
|
|
90
|
-
pps: true
|
|
91
|
-
},
|
|
92
|
-
/*
|
|
93
|
-
* params is the spec conform way to pass additional request parameters
|
|
94
|
-
*/
|
|
95
|
-
params: {
|
|
96
|
-
pass1: "pass1",
|
|
97
|
-
pass2: "pass2"
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
103
|
-
*/
|
|
104
|
-
(0, mocha_1.describe)('Tests on the xhr core when it starts to call the request', function () {
|
|
105
|
-
let oldFlatMap = null;
|
|
106
|
-
beforeEach(function () {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
let waitForResult = defaultMyFaces();
|
|
109
|
-
return waitForResult.then((close) => {
|
|
110
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
111
|
-
this.requests = [];
|
|
112
|
-
this.xhr.onCreate = (xhr) => {
|
|
113
|
-
this.requests.push(xhr);
|
|
114
|
-
};
|
|
115
|
-
global.XMLHttpRequest = this.xhr;
|
|
116
|
-
window.XMLHttpRequest = this.xhr;
|
|
117
|
-
this.jsfAjaxResponse = sinon.spy(global.faces.ajax, "response");
|
|
118
|
-
oldFlatMap = Array.prototype["flatMap"];
|
|
119
|
-
window["Es2019Array"] = mona_dish_1._Es2019Array;
|
|
120
|
-
delete Array.prototype["flatMap"];
|
|
121
|
-
this.closeIt = () => {
|
|
122
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
123
|
-
this.jsfAjaxResponse.restore();
|
|
124
|
-
Implementation.reset();
|
|
125
|
-
close();
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
afterEach(function () {
|
|
131
|
-
this.closeIt();
|
|
132
|
-
if (oldFlatMap) {
|
|
133
|
-
Array.prototype["flatMap"] = oldFlatMap;
|
|
134
|
-
oldFlatMap = null;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
(0, mocha_1.it)('must have the standard parameters all in', function (done) {
|
|
138
|
-
//issue a standard faces.ajax.request upon the standard simple form case and check the passed parameters
|
|
139
|
-
//and whether send was called
|
|
140
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
141
|
-
try {
|
|
142
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
143
|
-
issueStdReq(element);
|
|
144
|
-
(0, chai_1.expect)(this.requests.length).to.eq(1);
|
|
145
|
-
(0, chai_1.expect)(this.requests[0].method).to.eq("POST");
|
|
146
|
-
(0, chai_1.expect)(this.requests[0].async).to.be.true;
|
|
147
|
-
(0, chai_1.expect)(send.called).to.be.true;
|
|
148
|
-
(0, chai_1.expect)(send.callCount).to.eq(1);
|
|
149
|
-
//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
|
|
150
|
-
}
|
|
151
|
-
finally {
|
|
152
|
-
send.restore();
|
|
153
|
-
}
|
|
154
|
-
done();
|
|
155
|
-
});
|
|
156
|
-
(0, mocha_1.it)('it must have the pass through values properly passed', function (done) {
|
|
157
|
-
var _a, _b;
|
|
158
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
159
|
-
try {
|
|
160
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
161
|
-
issueStdReq(element);
|
|
162
|
-
(0, chai_1.expect)(send.called).to.be.true;
|
|
163
|
-
let argsVal = send.args[0][0];
|
|
164
|
-
let arsArr = argsVal.split("&");
|
|
165
|
-
let resultsMap = {};
|
|
166
|
-
for (let val of arsArr) {
|
|
167
|
-
let keyVal = val.split("=");
|
|
168
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
169
|
-
}
|
|
170
|
-
// normal request, all issuing form must be encoded!
|
|
171
|
-
(0, chai_1.expect)(!!((_a = resultsMap === null || resultsMap === void 0 ? void 0 : resultsMap["input_2_text"]) !== null && _a !== void 0 ? _a : false)).to.eq(true);
|
|
172
|
-
(0, chai_1.expect)(!!((_b = resultsMap === null || resultsMap === void 0 ? void 0 : resultsMap["input_1"]) !== null && _b !== void 0 ? _b : false)).to.eq(true);
|
|
173
|
-
(0, chai_1.expect)(resultsMap["pass1"]).to.eq("pass1");
|
|
174
|
-
(0, chai_1.expect)(resultsMap["pass2"]).to.eq("pass2");
|
|
175
|
-
(0, chai_1.expect)(!!resultsMap["render"]).to.be.false;
|
|
176
|
-
(0, chai_1.expect)(!!resultsMap["execute"]).to.be.false;
|
|
177
|
-
(0, chai_1.expect)(Const_1.P_WINDOW_ID in resultsMap).to.be.false;
|
|
178
|
-
(0, chai_1.expect)(Const_1.P_VIEWSTATE in resultsMap).to.be.true;
|
|
179
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_AJAX_SOURCE]).to.eq("input_2");
|
|
180
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_AJAX]).to.eq("true");
|
|
181
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_RENDER]).to.eq("blarg");
|
|
182
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_EXECUTE]).to.eq("input_1%20input_2");
|
|
183
|
-
}
|
|
184
|
-
finally {
|
|
185
|
-
send.restore();
|
|
186
|
-
}
|
|
187
|
-
done();
|
|
188
|
-
});
|
|
189
|
-
(0, mocha_1.it)('it must handle resetValues properly', function (done) {
|
|
190
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
191
|
-
try {
|
|
192
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
193
|
-
faces.ajax.request(element, null, {
|
|
194
|
-
execute: "input_1",
|
|
195
|
-
resetValues: true,
|
|
196
|
-
render: "@form",
|
|
197
|
-
params: {
|
|
198
|
-
pass1: "pass1",
|
|
199
|
-
pass2: "pass2"
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
(0, chai_1.expect)(send.called).to.be.true;
|
|
203
|
-
let argsVal = send.args[0][0];
|
|
204
|
-
let arsArr = argsVal.split("&");
|
|
205
|
-
let resultsMap = {};
|
|
206
|
-
for (let val of arsArr) {
|
|
207
|
-
let keyVal = val.split("=");
|
|
208
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
209
|
-
}
|
|
210
|
-
(0, chai_1.expect)(resultsMap["jakarta.faces.partial.resetValues"]).to.eq("true");
|
|
211
|
-
}
|
|
212
|
-
finally {
|
|
213
|
-
send.restore();
|
|
214
|
-
}
|
|
215
|
-
done();
|
|
216
|
-
});
|
|
217
|
-
(0, mocha_1.it)('it must have the proper target type', function (done) {
|
|
218
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
219
|
-
try {
|
|
220
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
221
|
-
issueStdReq(element);
|
|
222
|
-
(0, chai_1.expect)(this.requests[0].requestHeaders.Accept.indexOf("application/xml") != -1).to.be.true;
|
|
223
|
-
}
|
|
224
|
-
finally {
|
|
225
|
-
send.restore();
|
|
226
|
-
}
|
|
227
|
-
done();
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
(0, mocha_1.describe)('Tests after core when it hits response', function () {
|
|
231
|
-
beforeEach(function () {
|
|
232
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
-
let waitForResult = defaultMyFaces();
|
|
234
|
-
return waitForResult.then((close) => {
|
|
235
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
236
|
-
this.requests = [];
|
|
237
|
-
this.xhr.onCreate = (xhr) => {
|
|
238
|
-
this.requests.push(xhr);
|
|
239
|
-
};
|
|
240
|
-
global.XMLHttpRequest = this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
241
|
-
// @ts-ignore
|
|
242
|
-
window.XMLHttpRequest = this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
243
|
-
this.jsfAjaxResponse = sinon.spy(global.faces.ajax, "response");
|
|
244
|
-
this.closeIt = () => {
|
|
245
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
246
|
-
this.jsfAjaxResponse.restore();
|
|
247
|
-
Implementation.reset();
|
|
248
|
-
close();
|
|
249
|
-
};
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
afterEach(function () {
|
|
254
|
-
this.closeIt();
|
|
255
|
-
});
|
|
256
|
-
(0, mocha_1.it)('must have passed all ajax request phase events', function (done) {
|
|
257
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
258
|
-
let globalCnt = 0;
|
|
259
|
-
let localCnt = 0;
|
|
260
|
-
try {
|
|
261
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
262
|
-
faces.ajax.addOnEvent(() => {
|
|
263
|
-
globalCnt++;
|
|
264
|
-
});
|
|
265
|
-
faces.ajax.request(element, null, {
|
|
266
|
-
execute: "input_1",
|
|
267
|
-
render: "@form",
|
|
268
|
-
params: {
|
|
269
|
-
pass1: "pass1",
|
|
270
|
-
pass2: "pass2"
|
|
271
|
-
},
|
|
272
|
-
message: "Hello World",
|
|
273
|
-
onevent: (evt) => {
|
|
274
|
-
localCnt++;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
let xhrReq = this.requests[0];
|
|
278
|
-
let requestBody = xhrReq.requestBody.split("&");
|
|
279
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
280
|
-
(0, chai_1.expect)(requestBody.indexOf("pass1=pass1")).not.to.eq(-1);
|
|
281
|
-
(0, chai_1.expect)(requestBody.indexOf("pass2=pass2")).not.to.eq(-1);
|
|
282
|
-
(0, chai_1.expect)(requestBody.indexOf("message=Hello%20World")).not.to.eq(-1);
|
|
283
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
284
|
-
//success omitted due to fake response
|
|
285
|
-
(0, chai_1.expect)(globalCnt == 3).to.eq(true);
|
|
286
|
-
(0, chai_1.expect)(localCnt == 3).to.eq(true);
|
|
287
|
-
done();
|
|
288
|
-
}
|
|
289
|
-
catch (e) {
|
|
290
|
-
console.error(e);
|
|
291
|
-
}
|
|
292
|
-
finally {
|
|
293
|
-
send.restore();
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
(0, mocha_1.it)('it must have called request and the pass through values must be properly transferred ' +
|
|
297
|
-
'into the context, via the old non spec conform behavior', function (done) {
|
|
298
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
299
|
-
let globalCnt = 0;
|
|
300
|
-
let localCnt = 0;
|
|
301
|
-
let xhrReq = null;
|
|
302
|
-
try {
|
|
303
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
304
|
-
faces.ajax.addOnEvent(() => {
|
|
305
|
-
globalCnt++;
|
|
306
|
-
});
|
|
307
|
-
faces.ajax.request(element, null, {
|
|
308
|
-
execute: "input_1",
|
|
309
|
-
render: "@form",
|
|
310
|
-
pass1: "pass1",
|
|
311
|
-
pass2: "pass2",
|
|
312
|
-
onevent: (evt) => {
|
|
313
|
-
localCnt++;
|
|
314
|
-
if (evt.status == Const_1.COMPLETE) {
|
|
315
|
-
(0, chai_1.expect)(!!xhrReq.responseXML).to.be.true;
|
|
316
|
-
}
|
|
317
|
-
if (evt.status == Const_1.SUCCESS) {
|
|
318
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
319
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
320
|
-
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
321
|
-
(0, chai_1.expect)(lastArg.onevent != null).to.be.true;
|
|
322
|
-
(0, chai_1.expect)(lastArg.onevent instanceof Function).to.be.true;
|
|
323
|
-
(0, chai_1.expect)(!!lastArg.onError).to.be.false;
|
|
324
|
-
(0, chai_1.expect)(lastArg.pass1 == "pass1").to.be.true;
|
|
325
|
-
(0, chai_1.expect)(lastArg.pass2 == "pass2").to.be.true;
|
|
326
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX_SOURCE]).to.be.true;
|
|
327
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX]).to.be.true;
|
|
328
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_EXECUTE]).to.be.true;
|
|
329
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_RENDER]).to.be.true;
|
|
330
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
331
|
-
(0, chai_1.expect)(globalCnt == 2).to.eq(true); //local before global
|
|
332
|
-
(0, chai_1.expect)(localCnt == 3).to.eq(true);
|
|
333
|
-
done();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
xhrReq = this.requests[0];
|
|
338
|
-
xhrReq.responsetype = "text/xml";
|
|
339
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
340
|
-
}
|
|
341
|
-
catch (e) {
|
|
342
|
-
console.error(e);
|
|
343
|
-
}
|
|
344
|
-
finally {
|
|
345
|
-
send.restore();
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
(0, mocha_1.it)('it must have allow array key value pairs as passthroughs', function (done) {
|
|
349
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
350
|
-
let globalCnt = 0;
|
|
351
|
-
let localCnt = 0;
|
|
352
|
-
let xhrReq = null;
|
|
353
|
-
try {
|
|
354
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
355
|
-
faces.ajax.addOnEvent(() => {
|
|
356
|
-
globalCnt++;
|
|
357
|
-
});
|
|
358
|
-
faces.ajax.request(element, null, {
|
|
359
|
-
execute: "input_1",
|
|
360
|
-
render: "@form",
|
|
361
|
-
params: [["pass1", "pass1"],
|
|
362
|
-
["pass2", "pass2"]],
|
|
363
|
-
onevent: (evt) => {
|
|
364
|
-
localCnt++;
|
|
365
|
-
if (evt.status == Const_1.COMPLETE) {
|
|
366
|
-
(0, chai_1.expect)(!!xhrReq.responseXML).to.be.true;
|
|
367
|
-
}
|
|
368
|
-
if (evt.status == Const_1.SUCCESS) {
|
|
369
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
370
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
371
|
-
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
372
|
-
(0, chai_1.expect)(lastArg.onevent != null).to.be.true;
|
|
373
|
-
(0, chai_1.expect)(lastArg.onevent instanceof Function).to.be.true;
|
|
374
|
-
(0, chai_1.expect)(!!lastArg.onError).to.be.false;
|
|
375
|
-
(0, chai_1.expect)(lastArg.pass1 == "pass1").to.be.true;
|
|
376
|
-
(0, chai_1.expect)(lastArg.pass2 == "pass2").to.be.true;
|
|
377
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX_SOURCE]).to.be.true;
|
|
378
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX]).to.be.true;
|
|
379
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_EXECUTE]).to.be.true;
|
|
380
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_RENDER]).to.be.true;
|
|
381
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
382
|
-
(0, chai_1.expect)(globalCnt == 2).to.eq(true); //local before global
|
|
383
|
-
(0, chai_1.expect)(localCnt == 3).to.eq(true);
|
|
384
|
-
done();
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
xhrReq = this.requests[0];
|
|
389
|
-
xhrReq.responsetype = "text/xml";
|
|
390
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
391
|
-
}
|
|
392
|
-
catch (e) {
|
|
393
|
-
console.error(e);
|
|
394
|
-
}
|
|
395
|
-
finally {
|
|
396
|
-
send.restore();
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
(0, mocha_1.it)('it must have called request and the pass through values must be properly transferred into the context', function (done) {
|
|
400
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
401
|
-
let globalCnt = 0;
|
|
402
|
-
let localCnt = 0;
|
|
403
|
-
let xhrReq = null;
|
|
404
|
-
try {
|
|
405
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
406
|
-
faces.ajax.addOnEvent(() => {
|
|
407
|
-
globalCnt++;
|
|
408
|
-
});
|
|
409
|
-
faces.ajax.request(element, null, {
|
|
410
|
-
execute: "input_1",
|
|
411
|
-
render: "@form",
|
|
412
|
-
params: {
|
|
413
|
-
pass1: "pass1",
|
|
414
|
-
pass2: "pass2",
|
|
415
|
-
},
|
|
416
|
-
onevent: (evt) => {
|
|
417
|
-
localCnt++;
|
|
418
|
-
if (evt.status == Const_1.COMPLETE) {
|
|
419
|
-
(0, chai_1.expect)(!!xhrReq.responseXML).to.be.true;
|
|
420
|
-
}
|
|
421
|
-
if (evt.status == Const_1.SUCCESS) {
|
|
422
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
423
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
424
|
-
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
425
|
-
(0, chai_1.expect)(lastArg.onevent != null).to.be.true;
|
|
426
|
-
(0, chai_1.expect)(lastArg.onevent instanceof Function).to.be.true;
|
|
427
|
-
(0, chai_1.expect)(!!lastArg.onError).to.be.false;
|
|
428
|
-
(0, chai_1.expect)(lastArg.pass1 == "pass1").to.be.true;
|
|
429
|
-
(0, chai_1.expect)(lastArg.pass2 == "pass2").to.be.true;
|
|
430
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX_SOURCE]).to.be.true;
|
|
431
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_AJAX]).to.be.true;
|
|
432
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_EXECUTE]).to.be.true;
|
|
433
|
-
(0, chai_1.expect)(!!lastArg[Const_1.P_RENDER]).to.be.true;
|
|
434
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
435
|
-
(0, chai_1.expect)(globalCnt == 2).to.eq(true); //local before global
|
|
436
|
-
(0, chai_1.expect)(localCnt == 3).to.eq(true);
|
|
437
|
-
done();
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
xhrReq = this.requests[0];
|
|
442
|
-
xhrReq.responsetype = "text/xml";
|
|
443
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
444
|
-
}
|
|
445
|
-
catch (e) {
|
|
446
|
-
console.error(e);
|
|
447
|
-
}
|
|
448
|
-
finally {
|
|
449
|
-
send.restore();
|
|
450
|
-
}
|
|
451
|
-
});
|
|
452
|
-
(0, mocha_1.it)('it must have called onError in the error case', function (done) {
|
|
453
|
-
//on hold until it is clear why sinon is not giving me the response XML as expected
|
|
454
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
455
|
-
let xhrReq = null;
|
|
456
|
-
const oldErr = console.error;
|
|
457
|
-
try {
|
|
458
|
-
let errorCnt = 0;
|
|
459
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
460
|
-
faces.ajax.request(element, null, {
|
|
461
|
-
execute: "input_1",
|
|
462
|
-
render: "@form",
|
|
463
|
-
params: {
|
|
464
|
-
pass1: "pass1",
|
|
465
|
-
pass2: "pass2",
|
|
466
|
-
},
|
|
467
|
-
onerror: (error) => {
|
|
468
|
-
(0, chai_1.expect)(error.type).to.eq("error");
|
|
469
|
-
(0, chai_1.expect)(error.status).to.eq(null);
|
|
470
|
-
(0, chai_1.expect)(!!error.errorMessage).to.eq(true);
|
|
471
|
-
(0, chai_1.expect)(!!error.source).to.eq(true);
|
|
472
|
-
(0, chai_1.expect)(!!error.responseCode).to.eq(true);
|
|
473
|
-
(0, chai_1.expect)(!!error.responseText).to.eq(true);
|
|
474
|
-
(0, chai_1.expect)(!error.responseXML).to.eq(true);
|
|
475
|
-
done();
|
|
476
|
-
},
|
|
477
|
-
onevent: (evt) => {
|
|
478
|
-
if (evt.status == Const_1.COMPLETE) {
|
|
479
|
-
console.error = () => {
|
|
480
|
-
};
|
|
481
|
-
throw Error("This error is wanted, ignore the log");
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
xhrReq = this.requests[0];
|
|
486
|
-
xhrReq.responsetype = "text/xml";
|
|
487
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
488
|
-
}
|
|
489
|
-
catch (e) {
|
|
490
|
-
if (e.message.indexOf("This error is wanted") != -1) {
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
console.error(e);
|
|
494
|
-
}
|
|
495
|
-
finally {
|
|
496
|
-
console.error = oldErr;
|
|
497
|
-
send.restore();
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
// We can cover this TCK issue in a simple code unit test, the case is simple enough
|
|
501
|
-
(0, mocha_1.it)("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT )", (done) => {
|
|
502
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
503
|
-
try {
|
|
504
|
-
faces.ajax.request(element, null, {
|
|
505
|
-
execute: "input_1",
|
|
506
|
-
render: "@form",
|
|
507
|
-
delay: NaN,
|
|
508
|
-
params: {
|
|
509
|
-
pass1: "pass1",
|
|
510
|
-
pass2: "pass2",
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
catch (e) {
|
|
515
|
-
(0, chai_1.expect)(e.message.indexOf("NaN") > 0).to.eq(true, "Invalid NaN in message");
|
|
516
|
-
done();
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
done("Expecting a client error to be thrown");
|
|
520
|
-
});
|
|
521
|
-
(0, mocha_1.it)("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT ) - 2", (done) => {
|
|
522
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
523
|
-
try {
|
|
524
|
-
faces.ajax.request(element, null, {
|
|
525
|
-
execute: "input_1",
|
|
526
|
-
render: "@form",
|
|
527
|
-
delay: -1,
|
|
528
|
-
params: {
|
|
529
|
-
pass1: "pass1",
|
|
530
|
-
pass2: "pass2",
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
catch (e) {
|
|
535
|
-
(0, chai_1.expect)(e.message.indexOf("-1") > 0).to
|
|
536
|
-
.eq(true, "Invalid integer value in message");
|
|
537
|
-
done();
|
|
538
|
-
return;
|
|
539
|
-
}
|
|
540
|
-
done("Expecting a client error to be thrown");
|
|
541
|
-
});
|
|
542
|
-
(0, mocha_1.it)("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT ) - 3", (done) => {
|
|
543
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
544
|
-
try {
|
|
545
|
-
faces.ajax.request(element, null, {
|
|
546
|
-
execute: "input_1",
|
|
547
|
-
render: "@form",
|
|
548
|
-
delay: "booga",
|
|
549
|
-
params: {
|
|
550
|
-
pass1: "pass1",
|
|
551
|
-
pass2: "pass2",
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
catch (e) {
|
|
556
|
-
(0, chai_1.expect)(e.message.indexOf("booga") > 0).to.be
|
|
557
|
-
.eq(true, "Invalid string value in message");
|
|
558
|
-
done();
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
done("Expecting a client error to be thrown");
|
|
562
|
-
});
|
|
563
|
-
(0, mocha_1.it)("must have a proper working myfaces.pps = true, partial page submit", function (done) {
|
|
564
|
-
var _a, _b;
|
|
565
|
-
/**
|
|
566
|
-
* derived from the passthrough test
|
|
567
|
-
*/
|
|
568
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
569
|
-
try {
|
|
570
|
-
//we only issue input 1
|
|
571
|
-
let element = mona_dish_1.DomQuery.byId("input_1").getAsElem(0).value;
|
|
572
|
-
issueStdPPSReq(element);
|
|
573
|
-
(0, chai_1.expect)(send.called).to.be.true;
|
|
574
|
-
let argsVal = send.args[0][0];
|
|
575
|
-
let arsArr = argsVal.split("&");
|
|
576
|
-
let resultsMap = {};
|
|
577
|
-
for (let val of arsArr) {
|
|
578
|
-
let keyVal = val.split("=");
|
|
579
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
580
|
-
}
|
|
581
|
-
(0, chai_1.expect)((_a = resultsMap === null || resultsMap === void 0 ? void 0 : resultsMap["input_2_text"]) !== null && _a !== void 0 ? _a : false).to.eq(false);
|
|
582
|
-
(0, chai_1.expect)(!!((_b = resultsMap === null || resultsMap === void 0 ? void 0 : resultsMap["input_1"]) !== null && _b !== void 0 ? _b : false)).to.eq(true);
|
|
583
|
-
(0, chai_1.expect)(resultsMap["pass1"]).to.eq("pass1");
|
|
584
|
-
(0, chai_1.expect)(resultsMap["pass2"]).to.eq("pass2");
|
|
585
|
-
(0, chai_1.expect)(!!resultsMap["render"]).to.be.false;
|
|
586
|
-
(0, chai_1.expect)(!!resultsMap["execute"]).to.be.false;
|
|
587
|
-
(0, chai_1.expect)(Const_1.P_WINDOW_ID in resultsMap).to.be.false;
|
|
588
|
-
(0, chai_1.expect)(Const_1.P_VIEWSTATE in resultsMap).to.be.true;
|
|
589
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_AJAX_SOURCE]).to.eq("input_1");
|
|
590
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_AJAX]).to.eq("true");
|
|
591
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_RENDER]).to.eq("blarg");
|
|
592
|
-
(0, chai_1.expect)(resultsMap[Const_1.P_EXECUTE]).to.eq("input_1");
|
|
593
|
-
// TODO the request map only has the params and input1_ and input_2 passed no matter now many other values
|
|
594
|
-
// we might have to add some input elements into the form which are filtered out
|
|
595
|
-
}
|
|
596
|
-
finally {
|
|
597
|
-
send.restore();
|
|
598
|
-
}
|
|
599
|
-
done();
|
|
600
|
-
});
|
|
601
|
-
(0, mocha_1.it)("must handle the virtual issuing elements correctly", function () {
|
|
602
|
-
const waitForResult = initVirtualElement();
|
|
603
|
-
return waitForResult.then((close) => {
|
|
604
|
-
const send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
605
|
-
try {
|
|
606
|
-
let dqElem = mona_dish_1.DomQuery.byId("page:numbers");
|
|
607
|
-
let element = dqElem.getAsElem(0).value;
|
|
608
|
-
dqElem.querySelectorAll("input").click();
|
|
609
|
-
faces.ajax.request(element, null, {
|
|
610
|
-
execute: "jd_0:blarg",
|
|
611
|
-
render: "@form",
|
|
612
|
-
params: {
|
|
613
|
-
pass1: "pass1",
|
|
614
|
-
pass2: "pass2"
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
let argsVal = send.args[0][0];
|
|
618
|
-
let arsArr = argsVal.split("&");
|
|
619
|
-
let resultsMap = {};
|
|
620
|
-
let doubles = 0;
|
|
621
|
-
for (let val of arsArr) {
|
|
622
|
-
let keyVal = val.split("=");
|
|
623
|
-
if (!!resultsMap[keyVal[0]]) {
|
|
624
|
-
doubles++;
|
|
625
|
-
}
|
|
626
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
627
|
-
}
|
|
628
|
-
(0, chai_1.expect)(doubles).to.eq(2);
|
|
629
|
-
}
|
|
630
|
-
finally {
|
|
631
|
-
send.restore();
|
|
632
|
-
}
|
|
633
|
-
return true;
|
|
634
|
-
});
|
|
635
|
-
});
|
|
636
|
-
/**
|
|
637
|
-
* the idea is if a checkbox or radio button is the issuing element
|
|
638
|
-
* we cannot attach it if unchecked
|
|
639
|
-
*/
|
|
640
|
-
(0, mocha_1.it)("must handle issuing checkboxes and radio buttons with values correctly", () => {
|
|
641
|
-
const waitForResult = initCheckboxForm();
|
|
642
|
-
return waitForResult.then((close) => {
|
|
643
|
-
const send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
644
|
-
let dqElem = mona_dish_1.DomQuery.byId("page:numbers:1");
|
|
645
|
-
dqElem.removeAttribute("checked");
|
|
646
|
-
let element = dqElem.getAsElem(0).value;
|
|
647
|
-
faces.ajax.request(element, null, {
|
|
648
|
-
execute: "form1",
|
|
649
|
-
render: "@form",
|
|
650
|
-
params: {
|
|
651
|
-
pass1: "pass1",
|
|
652
|
-
pass2: "pass2"
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
let argsVal = send.args[0][0];
|
|
656
|
-
let arsArr = argsVal.split("&");
|
|
657
|
-
let resultsMap = {};
|
|
658
|
-
let doubles = 0;
|
|
659
|
-
for (let val of arsArr) {
|
|
660
|
-
let keyVal = val.split("=");
|
|
661
|
-
if (!!resultsMap[keyVal[0]]) {
|
|
662
|
-
doubles++;
|
|
663
|
-
}
|
|
664
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
665
|
-
}
|
|
666
|
-
//TODO test assert here
|
|
667
|
-
(0, chai_1.expect)(resultsMap["page%3Anumbers%3A1"]).to.not.exist;
|
|
668
|
-
//expect(doubles).to.eq(2);
|
|
669
|
-
});
|
|
670
|
-
});
|
|
671
|
-
/**
|
|
672
|
-
* the idea is if a checkbox or radio button is the issuing element
|
|
673
|
-
* if checked
|
|
674
|
-
*/
|
|
675
|
-
(0, mocha_1.it)("must handle issuing checkboxes and radio buttons with values correctly", () => {
|
|
676
|
-
const waitForResult = initCheckboxForm();
|
|
677
|
-
return waitForResult.then((close) => {
|
|
678
|
-
const send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
679
|
-
let dqElem = mona_dish_1.DomQuery.byId("page:numbers:1");
|
|
680
|
-
let element = dqElem.getAsElem(0).value;
|
|
681
|
-
faces.ajax.request(element, null, {
|
|
682
|
-
execute: "form1",
|
|
683
|
-
render: "@form",
|
|
684
|
-
params: {
|
|
685
|
-
pass1: "pass1",
|
|
686
|
-
pass2: "pass2"
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
let argsVal = send.args[0][0];
|
|
690
|
-
let arsArr = argsVal.split("&");
|
|
691
|
-
let resultsMap = {};
|
|
692
|
-
let doubles = 0;
|
|
693
|
-
for (let val of arsArr) {
|
|
694
|
-
let keyVal = val.split("=");
|
|
695
|
-
if (!!resultsMap[keyVal[0]]) {
|
|
696
|
-
doubles++;
|
|
697
|
-
}
|
|
698
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
699
|
-
}
|
|
700
|
-
//TODO test assert here
|
|
701
|
-
(0, chai_1.expect)(resultsMap["page%3Anumbers%3A1"]).to.eq("1");
|
|
702
|
-
//expect(doubles).to.eq(2);
|
|
703
|
-
});
|
|
704
|
-
});
|
|
705
|
-
(0, mocha_1.it)("must handle issuing checkboxes and radio buttons with values correctly", () => {
|
|
706
|
-
const waitForResult = initCheckboxForm();
|
|
707
|
-
return waitForResult.then((close) => {
|
|
708
|
-
const send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
709
|
-
let dqElem = mona_dish_1.DomQuery.byId("page:numbers:r:1");
|
|
710
|
-
dqElem.removeAttribute("checked");
|
|
711
|
-
let element = dqElem.getAsElem(0).value;
|
|
712
|
-
faces.ajax.request(element, null, {
|
|
713
|
-
execute: "form2",
|
|
714
|
-
render: "@form",
|
|
715
|
-
params: {
|
|
716
|
-
pass1: "pass1",
|
|
717
|
-
pass2: "pass2"
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
let argsVal = send.args[0][0];
|
|
721
|
-
let arsArr = argsVal.split("&");
|
|
722
|
-
let resultsMap = {};
|
|
723
|
-
let doubles = 0;
|
|
724
|
-
for (let val of arsArr) {
|
|
725
|
-
let keyVal = val.split("=");
|
|
726
|
-
if (!!resultsMap[keyVal[0]]) {
|
|
727
|
-
doubles++;
|
|
728
|
-
}
|
|
729
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
730
|
-
}
|
|
731
|
-
//TODO test assert here
|
|
732
|
-
(0, chai_1.expect)(resultsMap["page%3Anumbers%3Ar%3A1"]).to.not.exist;
|
|
733
|
-
//expect(doubles).to.eq(2);
|
|
734
|
-
});
|
|
735
|
-
});
|
|
736
|
-
(0, mocha_1.it)("must handle issuing checkboxes and radio buttons with values correctly with value", () => {
|
|
737
|
-
const waitForResult = initCheckboxForm();
|
|
738
|
-
return waitForResult.then((close) => {
|
|
739
|
-
const send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
740
|
-
let dqElem = mona_dish_1.DomQuery.byId("page:numbers:r:1");
|
|
741
|
-
let element = dqElem.getAsElem(0).value;
|
|
742
|
-
faces.ajax.request(element, null, {
|
|
743
|
-
execute: "form2",
|
|
744
|
-
render: "@form",
|
|
745
|
-
params: {
|
|
746
|
-
pass1: "pass1",
|
|
747
|
-
pass2: "pass2"
|
|
748
|
-
}
|
|
749
|
-
});
|
|
750
|
-
let argsVal = send.args[0][0];
|
|
751
|
-
let arsArr = argsVal.split("&");
|
|
752
|
-
let resultsMap = {};
|
|
753
|
-
let doubles = 0;
|
|
754
|
-
for (let val of arsArr) {
|
|
755
|
-
let keyVal = val.split("=");
|
|
756
|
-
if (!!resultsMap[keyVal[0]]) {
|
|
757
|
-
doubles++;
|
|
758
|
-
}
|
|
759
|
-
resultsMap[keyVal[0]] = keyVal[1];
|
|
760
|
-
}
|
|
761
|
-
//TODO test assert here
|
|
762
|
-
(0, chai_1.expect)(resultsMap["page%3Anumbers%3Ar%3A1"]).to.exist;
|
|
763
|
-
//expect(doubles).to.eq(2);
|
|
764
|
-
});
|
|
765
|
-
});
|
|
766
|
-
/**
|
|
767
|
-
* https://issues.apache.org/jira/browse/MYFACES-4638
|
|
768
|
-
*/
|
|
769
|
-
(0, mocha_1.it)("must pass values with & in its value correctly", function (done) {
|
|
770
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
771
|
-
let globalCnt = 0;
|
|
772
|
-
let localCnt = 0;
|
|
773
|
-
mona_dish_1.DomQuery.byId("input_1").val = "aaa&bbb";
|
|
774
|
-
try {
|
|
775
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
776
|
-
faces.ajax.addOnEvent(() => {
|
|
777
|
-
globalCnt++;
|
|
778
|
-
});
|
|
779
|
-
faces.ajax.request(element, null, {
|
|
780
|
-
execute: "input_1",
|
|
781
|
-
render: "@form",
|
|
782
|
-
params: {
|
|
783
|
-
pass1: "pass1",
|
|
784
|
-
pass2: "pass2"
|
|
785
|
-
},
|
|
786
|
-
message: "Hello World",
|
|
787
|
-
onevent: (evt) => {
|
|
788
|
-
localCnt++;
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
let xhrReq = this.requests[0];
|
|
792
|
-
let requestBody = xhrReq.requestBody.split("&");
|
|
793
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, STD_XML);
|
|
794
|
-
(0, chai_1.expect)(requestBody.indexOf("input_1=aaa%26bbb")).not.to.eq(-1);
|
|
795
|
-
(0, chai_1.expect)(requestBody.indexOf("pass1=pass1")).not.to.eq(-1);
|
|
796
|
-
(0, chai_1.expect)(requestBody.indexOf("pass2=pass2")).not.to.eq(-1);
|
|
797
|
-
(0, chai_1.expect)(requestBody.indexOf("message=Hello%20World")).not.to.eq(-1);
|
|
798
|
-
(0, chai_1.expect)(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
799
|
-
//success omitted due to fake response
|
|
800
|
-
(0, chai_1.expect)(globalCnt == 3).to.eq(true);
|
|
801
|
-
(0, chai_1.expect)(localCnt == 3).to.eq(true);
|
|
802
|
-
done();
|
|
803
|
-
}
|
|
804
|
-
catch (e) {
|
|
805
|
-
console.error(e);
|
|
806
|
-
}
|
|
807
|
-
finally {
|
|
808
|
-
send.restore();
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
(0, mocha_1.it)('must handle Chrome-style null responseXML with non-empty responseText as malformed XML error', function (done) {
|
|
812
|
-
// Chrome sets responseXML=null for unparseable XML but still provides responseText,
|
|
813
|
-
// which is the code path added in processRequestErrors for Chrome compatibility.
|
|
814
|
-
// We simulate this by responding with a non-XML content type so responseXML stays null.
|
|
815
|
-
try {
|
|
816
|
-
let element = mona_dish_1.DomQuery.byId("input_2").getAsElem(0).value;
|
|
817
|
-
faces.ajax.request(element, null, {
|
|
818
|
-
execute: "input_1",
|
|
819
|
-
render: "@form",
|
|
820
|
-
params: {
|
|
821
|
-
pass1: "pass1",
|
|
822
|
-
pass2: "pass2",
|
|
823
|
-
},
|
|
824
|
-
onerror: (error) => {
|
|
825
|
-
try {
|
|
826
|
-
(0, chai_1.expect)(error.type).to.eq("error");
|
|
827
|
-
(0, chai_1.expect)(error.status).to.eq("malformedXML");
|
|
828
|
-
done();
|
|
829
|
-
}
|
|
830
|
-
catch (e) {
|
|
831
|
-
done(e);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
let xhrReq = this.requests[0];
|
|
836
|
-
// Content-Type text/plain ensures responseXML is null while responseText is non-empty,
|
|
837
|
-
// matching Chrome's behavior when it encounters unparseable XML
|
|
838
|
-
xhrReq.respond(200, { 'Content-Type': 'text/plain' }, "this is not valid xml content");
|
|
839
|
-
}
|
|
840
|
-
catch (e) {
|
|
841
|
-
done(e);
|
|
842
|
-
}
|
|
843
|
-
});
|
|
844
|
-
});
|
|
845
|
-
//# sourceMappingURL=RequestTest.spec.js.map
|