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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
import {describe, it} from "mocha";
|
|
18
|
+
import {expect} from "chai";
|
|
19
|
+
import {Config} from "mona-dish";
|
|
20
|
+
import {decodeEncodedValues, encodeFormData, fixEmptyParameters} from "../../impl/util/FileUtils";
|
|
21
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
22
|
+
import {Implementation} from "../../impl/AjaxImpl";
|
|
23
|
+
|
|
24
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
|
+
|
|
26
|
+
// Pure functions — no DOM required.
|
|
27
|
+
describe("decodeEncodedValues", () => {
|
|
28
|
+
|
|
29
|
+
it("decodes a single key=value pair", () => {
|
|
30
|
+
expect(decodeEncodedValues("foo=bar")).to.deep.eq([["foo", "bar"]]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("splits multiple pairs on &", () => {
|
|
34
|
+
expect(decodeEncodedValues("a=1&b=2")).to.deep.eq([["a", "1"], ["b", "2"]]);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("returns a one-element array for a key-only segment (no =)", () => {
|
|
38
|
+
expect(decodeEncodedValues("keyonly")).to.deep.eq([["keyonly"]]);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("decodes percent-encoded characters in key and value", () => {
|
|
42
|
+
// %20 = space, %21 = !; the & between pairs is literal so both segments are decoded
|
|
43
|
+
expect(decodeEncodedValues("hello%20world=test%21&a=b"))
|
|
44
|
+
.to.deep.eq([["hello world", "test!"], ["a", "b"]]);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("splits only on the first = so values containing = are preserved", () => {
|
|
48
|
+
expect(decodeEncodedValues("key=val=ue")).to.deep.eq([["key", "val=ue"]]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("filters out blank and whitespace-only segments", () => {
|
|
52
|
+
expect(decodeEncodedValues("a=1& &b=2")).to.deep.eq([["a", "1"], ["b", "2"]]);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("returns an empty array for an empty string", () => {
|
|
56
|
+
expect(decodeEncodedValues("")).to.deep.eq([]);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe("fixEmptyParameters", () => {
|
|
61
|
+
|
|
62
|
+
it("fills both slots with empty arrays when the input is empty", () => {
|
|
63
|
+
expect(fixEmptyParameters([])).to.deep.eq([[], []]);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("fills the second slot with an empty array when only a key is present", () => {
|
|
67
|
+
expect(fixEmptyParameters(["key"])).to.deep.eq(["key", []]);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("passes through a two-element array unchanged", () => {
|
|
71
|
+
expect(fixEmptyParameters(["key", "val"])).to.deep.eq(["key", "val"]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("passes through arrays of three or more elements unchanged", () => {
|
|
75
|
+
expect(fixEmptyParameters(["key", "val", "extra"])).to.deep.eq(["key", "val", "extra"]);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// encodeFormData accesses window.File via ExtDomQuery.global(), so JSDOM is required.
|
|
80
|
+
describe("encodeFormData", () => {
|
|
81
|
+
|
|
82
|
+
beforeEach(async function () {
|
|
83
|
+
return defaultMyFaces().then((close) => {
|
|
84
|
+
this.closeIt = () => { Implementation.reset(); close(); };
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
afterEach(function () {
|
|
89
|
+
this.closeIt();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("returns the defaultStr when the config is absent", () => {
|
|
93
|
+
expect(encodeFormData(new Config(null), undefined, "FALLBACK")).to.eq("FALLBACK");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("returns empty string as default when no defaultStr is supplied and config is absent", () => {
|
|
97
|
+
expect(encodeFormData(new Config(null))).to.eq("");
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("encodes a single key-value pair", () => {
|
|
101
|
+
const config = new Config({name: ["Alice"]});
|
|
102
|
+
expect(encodeFormData(config)).to.eq("name=Alice");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("encodes multiple values for one key as separate params", () => {
|
|
106
|
+
const config = new Config({color: ["red", "blue"]});
|
|
107
|
+
expect(encodeFormData(config)).to.eq("color=red&color=blue");
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("percent-encodes special characters in keys and values", () => {
|
|
111
|
+
const config = new Config({"a b": ["x=y"]});
|
|
112
|
+
expect(encodeFormData(config)).to.eq("a%20b=x%3Dy");
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("applies the paramsMapper to rename keys before encoding", () => {
|
|
116
|
+
const config = new Config({originalKey: ["value"]});
|
|
117
|
+
const mapper = (_key: string, val: any) => ["renamedKey", val];
|
|
118
|
+
expect(encodeFormData(config, mapper)).to.eq("renamedKey=value");
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("filters out File instances from the encoded output", () => {
|
|
122
|
+
const file = new (window as any).File(["content"], "upload.txt");
|
|
123
|
+
const config = new Config({text: ["hello"], upload: [file]});
|
|
124
|
+
expect(encodeFormData(config)).to.eq("text=hello");
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -20,7 +20,8 @@ import {expect} from 'chai';
|
|
|
20
20
|
import * as sinon from 'sinon';
|
|
21
21
|
|
|
22
22
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
|
-
import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
23
|
+
import {CTX_PARAM_REQ_PASS_THR, IDENT_NONE, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
24
|
+
import {StateHolder} from "../../impl/core/ImplTypes";
|
|
24
25
|
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
26
|
import {_Es2019Array} from "mona-dish";
|
|
26
27
|
|
|
@@ -170,6 +171,22 @@ describe('faces.ajax.request test suite', () => {
|
|
|
170
171
|
|
|
171
172
|
})
|
|
172
173
|
|
|
174
|
+
it("execute @none must delete P_EXECUTE from the request pass-through context", () => {
|
|
175
|
+
const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
|
|
176
|
+
try {
|
|
177
|
+
DomQuery.byId("input_2").addEventListener("click", (event: Event) => {
|
|
178
|
+
faces.ajax.request(null, event, {execute: IDENT_NONE, render: IDENT_NONE});
|
|
179
|
+
}).click();
|
|
180
|
+
|
|
181
|
+
expect(addRequestToQueue.called).to.be.true;
|
|
182
|
+
const context = addRequestToQueue.args[0][2] as Config;
|
|
183
|
+
// remapDefaultConstants must have deleted P_EXECUTE when execute="@none"
|
|
184
|
+
expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).isAbsent()).to.be.true;
|
|
185
|
+
} finally {
|
|
186
|
+
addRequestToQueue.restore();
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
173
190
|
it("sidebehavior chain on undefined must not break the chain only a dedicated false does", function() {
|
|
174
191
|
let called = {};
|
|
175
192
|
window.called = called;
|
|
@@ -230,3 +247,60 @@ describe('faces.ajax.request test suite', () => {
|
|
|
230
247
|
});
|
|
231
248
|
|
|
232
249
|
|
|
250
|
+
describe('AjaxImpl.getClientWindow differenceCheck', () => {
|
|
251
|
+
let oldFlatMap = null;
|
|
252
|
+
|
|
253
|
+
beforeEach(async () => {
|
|
254
|
+
return await StandardInits.defaultMyFaces().then(() => {
|
|
255
|
+
oldFlatMap = Array.prototype["flatMap"];
|
|
256
|
+
(window as any)["Es2019Array"] = _Es2019Array;
|
|
257
|
+
delete Array.prototype["flatMap"];
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
afterEach(() => {
|
|
262
|
+
if (oldFlatMap) {
|
|
263
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
264
|
+
oldFlatMap = null;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it("must throw when two forms have different windowIds", () => {
|
|
269
|
+
document.body.innerHTML += `
|
|
270
|
+
<form id="form_wid_a">
|
|
271
|
+
<input type="hidden" name="jakarta.faces.ClientWindow" value="win1">
|
|
272
|
+
<input type="hidden" name="jakarta.faces.ViewState" value="vs1">
|
|
273
|
+
</form>
|
|
274
|
+
<form id="form_wid_b">
|
|
275
|
+
<input type="hidden" name="jakarta.faces.ClientWindow" value="win2">
|
|
276
|
+
<input type="hidden" name="jakarta.faces.ViewState" value="vs2">
|
|
277
|
+
</form>`;
|
|
278
|
+
|
|
279
|
+
expect(() => faces.getClientWindow(document.body)).to.throw();
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("must return the windowId when all forms agree", () => {
|
|
283
|
+
document.body.innerHTML = `
|
|
284
|
+
<form id="form_wid_ok">
|
|
285
|
+
<input type="hidden" name="jakarta.faces.ClientWindow" value="samewin">
|
|
286
|
+
<input type="hidden" name="jakarta.faces.ViewState" value="vs1">
|
|
287
|
+
</form>`;
|
|
288
|
+
|
|
289
|
+
const result = faces.getClientWindow(document.body);
|
|
290
|
+
expect(result).to.eq("samewin");
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
describe('StateHolder.hasNameSpace', () => {
|
|
295
|
+
it('returns false when id has no namespace prefix', () => {
|
|
296
|
+
const s = new StateHolder("jakarta.faces.ViewState", "val");
|
|
297
|
+
expect(s.hasNameSpace).to.be.false;
|
|
298
|
+
expect(s.nameSpace).to.eq("");
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it('returns true when id has a namespace prefix', () => {
|
|
302
|
+
const s = new StateHolder("myForm:jakarta.faces.ViewState", "val");
|
|
303
|
+
expect(s.hasNameSpace).to.be.true;
|
|
304
|
+
expect(s.nameSpace).to.eq("myForm");
|
|
305
|
+
});
|
|
306
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
import {describe, it} from "mocha";
|
|
18
|
+
import {expect} from "chai";
|
|
19
|
+
import {resolveContexts} from "../../impl/xhrCore/ResponseDataResolver";
|
|
20
|
+
import {
|
|
21
|
+
CTX_PARAM_MF_INTERNAL,
|
|
22
|
+
DEFERRED_HEAD_INSERTS,
|
|
23
|
+
UPDATE_ELEMS,
|
|
24
|
+
UPDATE_FORMS
|
|
25
|
+
} from "../../impl/core/Const";
|
|
26
|
+
|
|
27
|
+
describe("resolveContexts", () => {
|
|
28
|
+
|
|
29
|
+
it("creates a fresh internal context when none is present in the external context", () => {
|
|
30
|
+
const {externalContext, internalContext} = resolveContexts({});
|
|
31
|
+
|
|
32
|
+
expect(internalContext.isPresent(),
|
|
33
|
+
"internalContext must be present even when none was supplied").to.be.true;
|
|
34
|
+
expect(internalContext.getIf(DEFERRED_HEAD_INSERTS).value,
|
|
35
|
+
"DEFERRED_HEAD_INSERTS must be initialised to an empty array").to.deep.eq([]);
|
|
36
|
+
expect(internalContext.getIf(UPDATE_FORMS).value,
|
|
37
|
+
"UPDATE_FORMS must be initialised to an empty array").to.deep.eq([]);
|
|
38
|
+
expect(internalContext.getIf(UPDATE_ELEMS).value,
|
|
39
|
+
"UPDATE_ELEMS must be initialised to an empty array").to.deep.eq([]);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("reuses the existing internal context when one is present in the external context", () => {
|
|
43
|
+
// assign/getIf in mona-dish treat dot-strings as flat keys, not nested paths.
|
|
44
|
+
// CTX_PARAM_MF_INTERNAL = "myfaces.internal" is stored as a literal flat key.
|
|
45
|
+
const context = {[CTX_PARAM_MF_INTERNAL]: {existingKey: "existingValue"}};
|
|
46
|
+
const {externalContext, internalContext} = resolveContexts(context);
|
|
47
|
+
|
|
48
|
+
expect(internalContext.getIf("existingKey").value,
|
|
49
|
+
"existing internal context values must be preserved").to.eq("existingValue");
|
|
50
|
+
expect(internalContext.getIf(DEFERRED_HEAD_INSERTS).value,
|
|
51
|
+
"DEFERRED_HEAD_INSERTS must be initialised even when reusing an existing context").to.deep.eq([]);
|
|
52
|
+
expect(internalContext.getIf(UPDATE_FORMS).value).to.deep.eq([]);
|
|
53
|
+
expect(internalContext.getIf(UPDATE_ELEMS).value).to.deep.eq([]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("wraps the original object as the external context", () => {
|
|
57
|
+
const context = {source: "button1"};
|
|
58
|
+
const {externalContext} = resolveContexts(context);
|
|
59
|
+
|
|
60
|
+
expect(externalContext.getIf("source").value).to.eq("button1");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
import {afterEach, describe, it} from 'mocha';
|
|
18
18
|
import {expect} from 'chai';
|
|
19
19
|
|
|
20
|
-
import {ExtDomQuery} from "../../../impl/util/ExtDomQuery";
|
|
20
|
+
import {ExtConfig, ExtDomQuery} from "../../../impl/util/ExtDomQuery";
|
|
21
21
|
import {StandardInits} from "../../frameworkBase/_ext/shared/StandardInits";
|
|
22
22
|
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
23
23
|
import Sinon from "sinon";
|
|
24
|
+
import {Implementation} from "../../../impl/AjaxImpl";
|
|
24
25
|
|
|
25
26
|
declare var faces: any;
|
|
26
27
|
let oldProjectStage = null;
|
|
@@ -65,4 +66,93 @@ describe('ExtDomQuery test suite', () => {
|
|
|
65
66
|
}
|
|
66
67
|
done();
|
|
67
68
|
});
|
|
69
|
+
|
|
70
|
+
it('ExtDomQuery.nonce falls back to finding nonce on a faces script tag in the DOM', () => {
|
|
71
|
+
const script = document.createElement("script");
|
|
72
|
+
// /javax.faces.resource/jsf.js matches IS_FACES_SOURCE pattern \/javax\.faces\.resource.*\/jsf\.js.*
|
|
73
|
+
script.setAttribute("src", "/javax.faces.resource/jsf.js");
|
|
74
|
+
script.setAttribute("nonce", "test-nonce-abc");
|
|
75
|
+
document.head.appendChild(script);
|
|
76
|
+
try {
|
|
77
|
+
const nonce = new ExtDomQuery(document.body).nonce;
|
|
78
|
+
expect(nonce.value).to.eq("test-nonce-abc");
|
|
79
|
+
} finally {
|
|
80
|
+
document.head.removeChild(script);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('ExtDomQuery.runHeadInserts handles text nodes (no tagName) without throwing', () => {
|
|
85
|
+
const text = document.createTextNode("inline text");
|
|
86
|
+
expect(() => new ExtDomQuery(text as any).runHeadInserts()).not.to.throw();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('runHeadInserts with suppressDoubleIncludes=false inserts duplicate link resources', () => {
|
|
90
|
+
const href = "/test-res-no-dedup.css";
|
|
91
|
+
const existing = document.createElement("link");
|
|
92
|
+
existing.setAttribute("href", href);
|
|
93
|
+
document.head.appendChild(existing);
|
|
94
|
+
|
|
95
|
+
const before = document.head.querySelectorAll(`link[href="${href}"]`).length;
|
|
96
|
+
|
|
97
|
+
const dup = document.createElement("link");
|
|
98
|
+
dup.setAttribute("href", href);
|
|
99
|
+
new ExtDomQuery(dup as any).runHeadInserts(false);
|
|
100
|
+
|
|
101
|
+
expect(document.head.querySelectorAll(`link[href="${href}"]`).length).to.be.gt(before);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('runHeadInserts with suppressDoubleIncludes=true skips duplicate link resources', () => {
|
|
105
|
+
const href = "/test-res-with-dedup.css";
|
|
106
|
+
const existing = document.createElement("link");
|
|
107
|
+
existing.setAttribute("href", href);
|
|
108
|
+
document.head.appendChild(existing);
|
|
109
|
+
|
|
110
|
+
const before = document.head.querySelectorAll(`link[href="${href}"]`).length;
|
|
111
|
+
|
|
112
|
+
const dup = document.createElement("link");
|
|
113
|
+
dup.setAttribute("href", href);
|
|
114
|
+
new ExtDomQuery(dup as any).runHeadInserts(true);
|
|
115
|
+
|
|
116
|
+
expect(document.head.querySelectorAll(`link[href="${href}"]`).length).to.eq(before);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('ExtConfig', () => {
|
|
121
|
+
let closeIt: () => void;
|
|
122
|
+
|
|
123
|
+
beforeEach(async function () {
|
|
124
|
+
return defaultMyFaces().then((close) => {
|
|
125
|
+
closeIt = () => { Implementation.reset(); close(); };
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
afterEach(function () { closeIt(); });
|
|
130
|
+
|
|
131
|
+
it('append stores a value under the given key', () => {
|
|
132
|
+
const config = new ExtConfig({});
|
|
133
|
+
config.append("items").value = ["first"];
|
|
134
|
+
expect(config.getIf("items").value).to.deep.eq(["first"]);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('appendIf stores a value when condition is true', () => {
|
|
138
|
+
const config = new ExtConfig({});
|
|
139
|
+
config.appendIf(true, "key").value = ["yes"];
|
|
140
|
+
expect(config.getIf("key").value).to.deep.eq(["yes"]);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('appendIf is a no-op when condition is false', () => {
|
|
144
|
+
const config = new ExtConfig({existing: "val"});
|
|
145
|
+
config.appendIf(false, "existing");
|
|
146
|
+
expect(config.getIf("existing").value).to.eq("val");
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('deepCopy produces an independent copy', () => {
|
|
150
|
+
const config = new ExtConfig({name: "Alice"});
|
|
151
|
+
const copy = config.deepCopy;
|
|
152
|
+
expect(copy.getIf("name").value).to.eq("Alice");
|
|
153
|
+
// mutating the copy must not affect the original
|
|
154
|
+
copy.assign("name").value = "Bob";
|
|
155
|
+
expect(config.getIf("name").value).to.eq("Alice");
|
|
156
|
+
});
|
|
157
|
+
|
|
68
158
|
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
|
|
18
|
+
import {describe} from "mocha";
|
|
19
|
+
import {expect} from "chai";
|
|
20
|
+
import * as sinon from "sinon";
|
|
21
|
+
import {Config} from "mona-dish";
|
|
22
|
+
import {ExtLang} from "../../../impl/util/Lang";
|
|
23
|
+
import {StandardInits} from "../../frameworkBase/_ext/shared/StandardInits";
|
|
24
|
+
|
|
25
|
+
describe("ExtLang", function () {
|
|
26
|
+
|
|
27
|
+
beforeEach(function () {
|
|
28
|
+
return StandardInits.defaultMyFaces().then((close) => {
|
|
29
|
+
this.closeIt = close;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
afterEach(function () {
|
|
34
|
+
this.closeIt();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("must resolve messages with default fallback and template replacement", function () {
|
|
38
|
+
expect(ExtLang.getMessage("missing.key", "Hello {0}", "World")).to.eq("Hello World");
|
|
39
|
+
expect(ExtLang.getMessage("missing.key")).to.eq("missing.key");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("must return a message string when the key exists in Messages", function () {
|
|
43
|
+
// MSG_TEST is defined in Messages.ts as "Testmessage" — covers the left branch of ?? defaultMessage ?? key
|
|
44
|
+
expect(ExtLang.getMessage("MSG_TEST")).to.eq("Testmessage");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("must read global and local myfaces config with local priority", function () {
|
|
48
|
+
window.myfaces.config = {...window.myfaces.config, delay: 50, timeout: 100};
|
|
49
|
+
|
|
50
|
+
expect(ExtLang.getGlobalConfig("delay", 0)).to.eq(50);
|
|
51
|
+
expect(ExtLang.getGlobalConfig("unknown", 7)).to.eq(7);
|
|
52
|
+
|
|
53
|
+
const localOptions = new Config({myfaces: {config: {delay: 10}}});
|
|
54
|
+
|
|
55
|
+
expect(ExtLang.getLocalOrGlobalConfig(localOptions, "delay", 0)).to.eq(10);
|
|
56
|
+
expect(ExtLang.getLocalOrGlobalConfig(localOptions, "timeout", 0)).to.eq(100);
|
|
57
|
+
expect(ExtLang.getLocalOrGlobalConfig(localOptions, "unknown", 7)).to.eq(7);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("must convert associative objects to tuples and collect tuples back into an object", function () {
|
|
61
|
+
const tuples = ExtLang.ofAssoc({one: 1, two: 2});
|
|
62
|
+
|
|
63
|
+
expect(tuples).to.deep.eq([["one", 1], ["two", 2]]);
|
|
64
|
+
expect(tuples.reduce(ExtLang.collectAssoc, {})).to.deep.eq({one: 1, two: 2});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("must provide fail-safe resolving and execution helpers", function () {
|
|
68
|
+
let executed = false;
|
|
69
|
+
|
|
70
|
+
expect(ExtLang.failSaveResolve(() => "ok").value).to.eq("ok");
|
|
71
|
+
expect(ExtLang.failSaveResolve(() => { throw new Error("boom"); }, "fallback").isAbsent()).to.be.true;
|
|
72
|
+
expect(() => ExtLang.failSaveExecute(() => { executed = true; })).not.to.throw();
|
|
73
|
+
expect(() => ExtLang.failSaveExecute(() => { throw new Error("boom"); })).not.to.throw();
|
|
74
|
+
expect(executed).to.be.true;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("must resolve forms from direct form, form attribute and parent form", function () {
|
|
78
|
+
document.body.innerHTML = `
|
|
79
|
+
<form id="outer">
|
|
80
|
+
<button id="nested"></button>
|
|
81
|
+
</form>
|
|
82
|
+
<form id="target"></form>
|
|
83
|
+
<button id="detached" form="target"></button>`;
|
|
84
|
+
|
|
85
|
+
expect(ExtLang.getForm(document.getElementById("outer")!).id.value).to.eq("outer");
|
|
86
|
+
expect(ExtLang.getForm(document.getElementById("detached")!).id.value).to.eq("target");
|
|
87
|
+
expect(ExtLang.getForm(document.getElementById("nested")!).id.value).to.eq("outer");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("must debounce repeated calls by key", function () {
|
|
91
|
+
const clock = sinon.useFakeTimers();
|
|
92
|
+
let callCount = 0;
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
ExtLang.debounce("key", () => { callCount++; }, 50);
|
|
96
|
+
ExtLang.debounce("key", () => { callCount++; }, 50);
|
|
97
|
+
|
|
98
|
+
clock.tick(49);
|
|
99
|
+
expect(callCount).to.eq(0);
|
|
100
|
+
|
|
101
|
+
clock.tick(1);
|
|
102
|
+
expect(callCount).to.eq(1);
|
|
103
|
+
|
|
104
|
+
ExtLang.debounce("immediate", () => { callCount++; }, 0);
|
|
105
|
+
expect(callCount).to.eq(2);
|
|
106
|
+
} finally {
|
|
107
|
+
clock.restore();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
|
|
18
|
+
import {describe} from "mocha";
|
|
19
|
+
import {expect} from "chai";
|
|
20
|
+
import {DQ} from "mona-dish";
|
|
21
|
+
import {Implementation} from "../../../impl/AjaxImpl";
|
|
22
|
+
import {HiddenInputBuilder} from "../../../impl/util/HiddenInputBuilder";
|
|
23
|
+
import {StandardInits} from "../../frameworkBase/_ext/shared/StandardInits";
|
|
24
|
+
|
|
25
|
+
describe("HiddenInputBuilder", function () {
|
|
26
|
+
|
|
27
|
+
beforeEach(function () {
|
|
28
|
+
return StandardInits.defaultMyFaces().then((close) => {
|
|
29
|
+
this.closeIt = () => {
|
|
30
|
+
Implementation.reset();
|
|
31
|
+
close();
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterEach(function () {
|
|
37
|
+
this.closeIt();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("must build and append the next ViewState hidden input for a named view root", function () {
|
|
41
|
+
document.body.innerHTML = `
|
|
42
|
+
<form id="viewroot_1:form1">
|
|
43
|
+
<input type="hidden" id="viewroot_1:jakarta.faces.ViewState:2" name="viewroot_1:jakarta.faces.ViewState" value="old">
|
|
44
|
+
</form>`;
|
|
45
|
+
|
|
46
|
+
const form = DQ.byId("viewroot_1:form1");
|
|
47
|
+
const hiddenInput = new HiddenInputBuilder("input[name*='jakarta.faces.ViewState']")
|
|
48
|
+
.withNamingContainerId("viewroot_1")
|
|
49
|
+
.withNamedViewRoot(true)
|
|
50
|
+
.withParent(form)
|
|
51
|
+
.build();
|
|
52
|
+
|
|
53
|
+
hiddenInput.val = "new";
|
|
54
|
+
|
|
55
|
+
expect(hiddenInput.id.value).to.eq("viewroot_1:jakarta.faces.ViewState:3");
|
|
56
|
+
expect(hiddenInput.name.value).to.eq("viewroot_1:jakarta.faces.ViewState");
|
|
57
|
+
expect(hiddenInput.val).to.eq("new");
|
|
58
|
+
expect(form.querySelectorAll("#viewroot_1\\:jakarta\\.faces\\.ViewState\\:3").isPresent()).to.be.true;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("must build ClientWindow without prefixing the name for a non-named view root", function () {
|
|
62
|
+
document.body.innerHTML = `<form id="form1"></form>`;
|
|
63
|
+
|
|
64
|
+
const hiddenInput = new HiddenInputBuilder("input[name*='jakarta.faces.ClientWindow']")
|
|
65
|
+
.withNamingContainerId("viewroot_1")
|
|
66
|
+
.withNamedViewRoot(false)
|
|
67
|
+
.withParent(DQ.byId("form1"))
|
|
68
|
+
.build();
|
|
69
|
+
|
|
70
|
+
expect(hiddenInput.id.value).to.eq("viewroot_1:jakarta.faces.ClientWindow:1");
|
|
71
|
+
expect(hiddenInput.name.value).to.eq("jakarta.faces.ClientWindow");
|
|
72
|
+
expect(DQ.byId("form1").querySelectorAll("[name='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -130,5 +130,65 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
130
130
|
|
|
131
131
|
})
|
|
132
132
|
|
|
133
|
+
it('onsubmit must receive null for compatibility', function () {
|
|
134
|
+
let FORM_ID = "blarg";
|
|
135
|
+
let form = DomQuery.byId(FORM_ID);
|
|
136
|
+
const onsumbit = Sinon.spy(() => false);
|
|
137
|
+
const submit_spy = Sinon.spy(() => {
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
(form.value.value as any).onsubmit = onsumbit;
|
|
141
|
+
(form.value.value as any).submit = submit_spy;
|
|
142
|
+
|
|
143
|
+
submitForm(FORM_ID, 'mylink', 'target1', {
|
|
144
|
+
booga1: "val_booga1",
|
|
145
|
+
booga2: "val_booga2"
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
expect(onsumbit.calledOnce).to.eq(true);
|
|
149
|
+
expect(onsumbit.firstCall.args.length).to.eq(1);
|
|
150
|
+
expect((onsumbit.firstCall.args as any[])[0]).to.eq(null);
|
|
151
|
+
expect(submit_spy.called).to.eq(false);
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
it('setHiddenInput must update the value when the field already exists', function () {
|
|
155
|
+
let FORM_ID = "blarg";
|
|
156
|
+
setHiddenInput(FORM_ID, "existing_field", "first_value");
|
|
157
|
+
setHiddenInput(FORM_ID, "existing_field", "updated_value");
|
|
158
|
+
const inputs = DomQuery.byId(FORM_ID).querySelectorAll("input[name='existing_field']");
|
|
159
|
+
expect(inputs.length).to.eq(1, "must not create a duplicate input");
|
|
160
|
+
expect(inputs.inputValue.value).to.eq("updated_value", "must update the value in-place");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it('clearHiddenInput must not throw when the field does not exist', function () {
|
|
164
|
+
let FORM_ID = "blarg";
|
|
165
|
+
expect(() => clearHiddenInput(FORM_ID, "nonexistent_field")).not.to.throw();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('submitForm must work with array-style params', function () {
|
|
169
|
+
let FORM_ID = "blarg";
|
|
170
|
+
let form = DomQuery.byId(FORM_ID);
|
|
171
|
+
const submit_spy = Sinon.spy(() => {});
|
|
172
|
+
(form.value.value as any).submit = submit_spy;
|
|
173
|
+
|
|
174
|
+
submitForm(FORM_ID, 'mylink', null, [["arrKey1", "arrVal1"], ["arrKey2", "arrVal2"]]);
|
|
175
|
+
|
|
176
|
+
expect(submit_spy.called).to.eq(true);
|
|
177
|
+
form = DomQuery.byId(FORM_ID);
|
|
178
|
+
expect(form.querySelectorAll("input[name='arrKey1']").isAbsent()).to.eq(true, "params must be cleaned up after submit");
|
|
179
|
+
expect(form.querySelectorAll("input[name='arrKey2']").isAbsent()).to.eq(true, "params must be cleaned up after submit");
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('submitForm must work when params is null', function () {
|
|
183
|
+
let FORM_ID = "blarg";
|
|
184
|
+
let form = DomQuery.byId(FORM_ID);
|
|
185
|
+
const submit_spy = Sinon.spy(() => {});
|
|
186
|
+
(form.value.value as any).submit = submit_spy;
|
|
187
|
+
|
|
188
|
+
submitForm(FORM_ID, null, null, null);
|
|
189
|
+
|
|
190
|
+
expect(submit_spy.called).to.eq(true);
|
|
191
|
+
});
|
|
192
|
+
|
|
133
193
|
// further tests will follow if needed, for now the namespace must be restored
|
|
134
|
-
});
|
|
194
|
+
});
|