jsf.js_next_gen 1.0.0-beta-19 → 4.0.0-RC-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +81 -24
- package/dist/docs/assets/highlight.css +21 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +34 -2
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
- package/dist/docs/functions/myfaces.ab.html +10 -8
- package/dist/docs/index.html +74 -29
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
- package/dist/docs/modules/faces.html +75 -0
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
- package/dist/docs/modules/myfaces.html +8 -6
- package/dist/docs/modules.html +9 -7
- package/dist/docs/variables/faces.contextpath.html +57 -0
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
- package/dist/docs/variables/faces.specversion.html +64 -0
- package/dist/docs/variables/myfaces.oam.html +8 -6
- package/dist/window/faces-development.js +7688 -0
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +87 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +3043 -3018
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +2 -1
- package/dist/window/jsf.js.LICENSE.txt +87 -0
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +12 -12
- package/pom.xml +14 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
- package/src/main/typescript/@types/definitions/index.d.ts +147 -0
- package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
- package/src/main/typescript/api/faces.ts +44 -0
- package/src/main/typescript/api/jsf.ts +43 -0
- package/src/main/typescript/impl/AjaxImpl.ts +39 -42
- package/src/main/typescript/impl/PushImpl.ts +27 -30
- package/src/main/typescript/impl/core/Const.ts +38 -16
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +3 -3
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
- package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
- package/src/main/typescript/myfaces/OamSubmit.ts +51 -86
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -6
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +78 -33
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -7
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +99 -17
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
- package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
- package/src/main/typescript/tsconfig-typedoc.json +17 -1
- package/src/main/typescript/tsconfig.json +24 -5
- package/src/test/resources/jsf-development.js +1 -1
- package/src/test.html +75 -0
- package/src/tmp/test.html +92 -0
- package/target/api/{Jsf.js → _api.js} +68 -70
- package/target/api/_api.js.map +1 -0
- package/target/api/faces.js +45 -0
- package/target/api/faces.js.map +1 -0
- package/target/api/jsf.js +45 -0
- package/target/api/jsf.js.map +1 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +85 -93
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +63 -64
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +38 -19
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +10 -15
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +5 -6
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +12 -21
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +235 -138
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +43 -50
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +37 -62
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +12 -14
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +27 -29
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +40 -36
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +165 -167
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +75 -103
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +160 -145
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
- package/target/myfaces/OamSubmit.js +63 -74
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -111
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -37
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +300 -121
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +68 -33
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +133 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +45 -21
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +90 -18
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +24 -30
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +63 -71
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +70 -83
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +15 -17
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +73 -91
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +72 -98
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +107 -120
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
- package/target/test/xhrCore/ResponseTest.spec.js +206 -105
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
- package/target/test/xhrCore/ShadowDomTest.spec.js +56 -66
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +87 -97
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +65 -16
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/jsf-development.js +452 -3674
- package/target/test-classes/jsf.js +1 -1
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/webpack.config.js +7 -4
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +23 -4
- package/dist/docs/modules/jsf.html +0 -71
- package/dist/docs/variables/jsf.specversion.html +0 -52
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
- package/src/main/types/typedefs.d.ts +0 -66
- package/target/api/Jsf.js.map +0 -1
- package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
- package/target/impl/util/ListenerQueue.js +0 -3
- package/target/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/api/Jsf.js +0 -258
- package/target/main/typescript/api/Jsf.js.map +0 -1
- package/target/main/typescript/impl/AjaxImpl.js +0 -569
- package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/main/typescript/impl/PushImpl.js +0 -215
- package/target/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/main/typescript/impl/core/Const.js +0 -135
- package/target/main/typescript/impl/core/Const.js.map +0 -1
- package/target/main/typescript/impl/core/ImplTypes.js +0 -43
- package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/main/typescript/impl/i18n/Messages.js +0 -114
- package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/main/typescript/impl/util/Assertions.js +0 -90
- package/target/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
- package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/main/typescript/impl/util/Lang.js +0 -215
- package/target/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
- package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
- package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/Response.js +0 -167
- package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/LangTest.js +0 -112
- package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/typescript/impl/ImplTest.js +0 -98
- package/target/test/typescript/impl/ImplTest.js.map +0 -1
- package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
- package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
- package/target/test/typescript/xhrCore/EventTests.js +0 -155
- package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
- package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
- package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
- package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// noinspection HtmlUnknownAttribute
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
2
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
5
3
|
* contributor license agreements. See the NOTICE file distributed with
|
|
6
4
|
* this work for additional information regarding copyright ownership.
|
|
@@ -16,78 +14,147 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
14
|
* See the License for the specific language governing permissions and
|
|
17
15
|
* limitations under the License.
|
|
18
16
|
*/
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const chai_1 = require("chai");
|
|
28
|
+
const mocha_1 = require("mocha");
|
|
29
|
+
const mona_dish_1 = require("mona-dish");
|
|
23
30
|
var trim = mona_dish_1.Lang.trim;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const rxjs_1 = require("rxjs");
|
|
32
|
+
const jsdom = require("jsdom");
|
|
33
|
+
const { JSDOM } = jsdom;
|
|
34
|
+
global.window = {};
|
|
35
|
+
let dom = null;
|
|
27
36
|
(0, mocha_1.describe)('DOMQuery tests', function () {
|
|
28
37
|
beforeEach(function () {
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
// language=HTML
|
|
39
|
+
dom = new JSDOM(`
|
|
40
|
+
<!DOCTYPE html>
|
|
41
|
+
<html lang="en">
|
|
42
|
+
<head>
|
|
43
|
+
<meta charset="UTF-8">
|
|
44
|
+
<title>Title</title>
|
|
45
|
+
</head>
|
|
46
|
+
<body>
|
|
47
|
+
<div id="id_1"></div>
|
|
48
|
+
<div id="id_2" booga="blarg" class="blarg2"></div>
|
|
49
|
+
<div id="id_3" class="blarg1 blarg2"></div>
|
|
50
|
+
<div id="id_4"></div>
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
53
|
+
|
|
54
|
+
`, {
|
|
31
55
|
contentType: "text/html",
|
|
32
|
-
runScripts: "dangerously"
|
|
56
|
+
runScripts: "dangerously",
|
|
57
|
+
resources: "usable",
|
|
58
|
+
url: `file://${__dirname}/index.html`
|
|
33
59
|
});
|
|
34
|
-
|
|
60
|
+
let window = dom.window;
|
|
61
|
+
global.dom = dom;
|
|
35
62
|
global.window = window;
|
|
36
63
|
global.body = window.document.body;
|
|
37
64
|
global.document = window.document;
|
|
38
65
|
global.navigator = {
|
|
39
66
|
language: "en-En"
|
|
40
67
|
};
|
|
41
|
-
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
42
|
-
this.requests = [];
|
|
43
|
-
this.xhr.onCreate = function (xhr) {
|
|
44
|
-
_this.requests.push(xhr);
|
|
45
|
-
};
|
|
46
|
-
global.XMLHttpRequest = this.xhr;
|
|
47
|
-
window.XMLHttpRequest = this.xhr;
|
|
48
68
|
});
|
|
49
69
|
this.afterEach(function () {
|
|
50
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
51
70
|
});
|
|
52
71
|
(0, mocha_1.it)('basic init', function () {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
let probe1 = new mona_dish_1.DomQuery(window.document.body);
|
|
73
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
74
|
+
let probe3 = new mona_dish_1.DomQuery(probe1, probe2);
|
|
75
|
+
let probe4 = new mona_dish_1.DomQuery(window.document.body, probe3);
|
|
57
76
|
(0, chai_1.expect)(probe1.length).to.be.eq(1);
|
|
58
77
|
(0, chai_1.expect)(probe2.length == 4).to.be.true;
|
|
59
78
|
(0, chai_1.expect)(probe3.length == 5).to.be.true;
|
|
60
79
|
//still under discussion (we might index to avoid doubles)
|
|
61
80
|
(0, chai_1.expect)(probe4.length == 6).to.be.true;
|
|
62
81
|
});
|
|
82
|
+
(0, mocha_1.it)('proper iterator api and rxjs mapping', function () {
|
|
83
|
+
let probe1 = new mona_dish_1.DomQuery(window.document.body);
|
|
84
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
85
|
+
let o1 = (0, rxjs_1.from)(probe1.stream);
|
|
86
|
+
let o2 = (0, rxjs_1.from)(probe2.stream);
|
|
87
|
+
let cnt1 = 0;
|
|
88
|
+
let isDQuery = false;
|
|
89
|
+
let cnt2 = 0;
|
|
90
|
+
o1.subscribe(() => {
|
|
91
|
+
cnt1++;
|
|
92
|
+
});
|
|
93
|
+
o2.subscribe((item) => {
|
|
94
|
+
cnt2++;
|
|
95
|
+
isDQuery = (item.length == 1) && (item instanceof mona_dish_1.DomQuery);
|
|
96
|
+
});
|
|
97
|
+
(0, chai_1.expect)(probe1.length).to.be.eq(1);
|
|
98
|
+
(0, chai_1.expect)(probe2.length == 4).to.be.true;
|
|
99
|
+
(0, chai_1.expect)(isDQuery).to.be.true;
|
|
100
|
+
});
|
|
101
|
+
(0, mocha_1.it)('proper iterator api and rxjs mapping with observable', function () {
|
|
102
|
+
let probe1 = new mona_dish_1.DomQuery(window.document.body);
|
|
103
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
104
|
+
let o1 = (0, rxjs_1.from)(probe1.stream);
|
|
105
|
+
let o2 = (0, rxjs_1.from)(probe2.stream);
|
|
106
|
+
let cnt1 = 0;
|
|
107
|
+
let isDQuery = false;
|
|
108
|
+
let cnt2 = 0;
|
|
109
|
+
o1.subscribe(() => {
|
|
110
|
+
cnt1++;
|
|
111
|
+
});
|
|
112
|
+
o2.subscribe((item) => {
|
|
113
|
+
cnt2++;
|
|
114
|
+
isDQuery = (item.length == 1) && (item instanceof mona_dish_1.DomQuery);
|
|
115
|
+
});
|
|
116
|
+
(0, chai_1.expect)(probe1.length).to.be.eq(1);
|
|
117
|
+
(0, chai_1.expect)(probe2.length == 4).to.be.true;
|
|
118
|
+
(0, chai_1.expect)(isDQuery).to.be.true;
|
|
119
|
+
});
|
|
63
120
|
(0, mocha_1.it)('domquery ops test filter', function () {
|
|
64
|
-
|
|
65
|
-
probe2 = probe2.filter(
|
|
121
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
122
|
+
probe2 = probe2.filter((item) => item.id.match((id) => id != "id_1"));
|
|
66
123
|
(0, chai_1.expect)(probe2.length == 3);
|
|
67
124
|
});
|
|
68
125
|
(0, mocha_1.it)('global eval test', function () {
|
|
69
|
-
|
|
70
|
-
probe2 = probe2.filter(
|
|
126
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
127
|
+
probe2 = probe2.filter((item) => item.id.match((id) => id != "id_1"));
|
|
71
128
|
(0, chai_1.expect)(probe2.length == 3);
|
|
72
129
|
});
|
|
73
130
|
(0, mocha_1.it)('must detach', function () {
|
|
74
|
-
|
|
131
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div#id_1");
|
|
75
132
|
probe2.detach();
|
|
76
133
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("div#id_1").isPresent()).to.be.false;
|
|
77
134
|
probe2.appendTo(mona_dish_1.DomQuery.querySelectorAll("body"));
|
|
78
135
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("div#id_1").isPresent()).to.be.true;
|
|
79
136
|
});
|
|
80
|
-
(0, mocha_1.it)('domquery ops test2 each',
|
|
81
|
-
|
|
137
|
+
(0, mocha_1.it)('domquery ops test2 each', () => {
|
|
138
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div#id_1");
|
|
82
139
|
mona_dish_1.DomQuery.globalEval("document.getElementById('id_1').innerHTML = 'hello'");
|
|
83
140
|
(0, chai_1.expect)(probe2.html().value).to.eq("hello");
|
|
141
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId(document.head).innerHTML.indexOf("document.getElementById('id_1').innerHTML = 'hello'")).to.eq(-1);
|
|
84
142
|
mona_dish_1.DomQuery.globalEval("document.getElementById('id_1').innerHTML = 'hello2'", "nonci");
|
|
85
143
|
(0, chai_1.expect)(probe2.html().value).to.eq("hello2");
|
|
86
144
|
});
|
|
145
|
+
(0, mocha_1.it)('domquery ops test2 with sticky eval code', () => {
|
|
146
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div#id_1");
|
|
147
|
+
mona_dish_1.DomQuery.globalEvalSticky("document.getElementById('id_1').innerHTML = 'hello'");
|
|
148
|
+
(0, chai_1.expect)(probe2.html().value).to.eq("hello");
|
|
149
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId(document.head).innerHTML.indexOf("document.getElementById('id_1').innerHTML = 'hello'")).not.to.eq(-1);
|
|
150
|
+
mona_dish_1.DomQuery.globalEvalSticky("document.getElementById('id_1').innerHTML = 'hello2'", "nonci");
|
|
151
|
+
(0, chai_1.expect)(probe2.html().value).to.eq("hello2");
|
|
152
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId(document.head).innerHTML.indexOf("document.getElementById('id_1').innerHTML = 'hello2'")).not.to.eq(-1);
|
|
153
|
+
});
|
|
87
154
|
(0, mocha_1.it)('domquery ops test2 eachNode', function () {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
probe2.each(
|
|
155
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
156
|
+
let noIter = 0;
|
|
157
|
+
probe2.each((item, cnt) => {
|
|
91
158
|
(0, chai_1.expect)(item instanceof mona_dish_1.DomQuery).to.be.true;
|
|
92
159
|
(0, chai_1.expect)(noIter == cnt).to.be.true;
|
|
93
160
|
noIter++;
|
|
@@ -95,43 +162,77 @@ var JSDOM = jsdom.JSDOM;
|
|
|
95
162
|
(0, chai_1.expect)(noIter == 4).to.be.true;
|
|
96
163
|
});
|
|
97
164
|
(0, mocha_1.it)('domquery ops test2 byId', function () {
|
|
98
|
-
|
|
165
|
+
let probe2 = mona_dish_1.DomQuery.byId("id_1");
|
|
99
166
|
(0, chai_1.expect)(probe2.length == 1).to.be.true;
|
|
100
167
|
probe2 = mona_dish_1.DomQuery.byTagName("div");
|
|
101
168
|
(0, chai_1.expect)(probe2.length == 4).to.be.true;
|
|
102
169
|
});
|
|
103
170
|
(0, mocha_1.it)('outerhtml and eval tests', function () {
|
|
104
|
-
|
|
105
|
-
probe1.querySelectorAll("#id_1").outerHTML(
|
|
171
|
+
let probe1 = new mona_dish_1.DomQuery(window.document.body);
|
|
172
|
+
probe1.querySelectorAll("#id_1").outerHTML(`
|
|
173
|
+
<div id='barg'>
|
|
174
|
+
|
|
175
|
+
</div>
|
|
176
|
+
<script type="text/javascript">
|
|
177
|
+
document.getElementById('blarg').innerHTML = 'hello world';
|
|
178
|
+
</script>
|
|
179
|
+
`, true, true);
|
|
106
180
|
(0, chai_1.expect)(window.document.body.innerHTML.indexOf("hello world") != -1).to.be.true;
|
|
107
181
|
(0, chai_1.expect)(window.document.head.innerHTML.indexOf("hello world") == -1).to.be.true;
|
|
108
182
|
(0, chai_1.expect)(window.document.body.innerHTML.indexOf("id_1") == -1).to.be.true;
|
|
109
183
|
(0, chai_1.expect)(window.document.body.innerHTML.indexOf("blarg") != -1).to.be.true;
|
|
110
184
|
});
|
|
111
|
-
(0, mocha_1.it)('
|
|
112
|
-
|
|
185
|
+
(0, mocha_1.it)('attr test and eval tests', function () {
|
|
186
|
+
let probe1 = new mona_dish_1.DomQuery(document);
|
|
113
187
|
probe1.querySelectorAll("div#id_2").attr("style").value = "border=1;";
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
188
|
+
let blarg = probe1.querySelectorAll("div#id_2").attr("booga").value;
|
|
189
|
+
let style = probe1.querySelectorAll("div#id_2").attr("style").value;
|
|
190
|
+
let nonexistent = probe1.querySelectorAll("div#id_2").attr("buhaha").value;
|
|
117
191
|
(0, chai_1.expect)(blarg).to.be.eq("blarg");
|
|
118
192
|
(0, chai_1.expect)(style).to.be.eq("border=1;");
|
|
119
193
|
(0, chai_1.expect)(nonexistent).to.be.eq(null);
|
|
120
194
|
});
|
|
195
|
+
(0, mocha_1.it)('style must work ', function () {
|
|
196
|
+
let probe1 = new mona_dish_1.DomQuery(document);
|
|
197
|
+
let probe = probe1.querySelectorAll("div#id_2");
|
|
198
|
+
probe.style("border").value = "10px solid red";
|
|
199
|
+
probe.style("color").value = "blue";
|
|
200
|
+
let styleNodeLevel = probe.getAsElem(0).value.style['color'];
|
|
201
|
+
(0, chai_1.expect)(probe.style("border").value).to.eq("10px solid red");
|
|
202
|
+
(0, chai_1.expect)(probe.style("color").value).to.eq("blue");
|
|
203
|
+
(0, chai_1.expect)(styleNodeLevel).to.eq('blue');
|
|
204
|
+
});
|
|
121
205
|
(0, mocha_1.it)('must perform addClass and hasClass correctly', function () {
|
|
122
|
-
|
|
123
|
-
|
|
206
|
+
let probe1 = new mona_dish_1.DomQuery(document);
|
|
207
|
+
let element = probe1.querySelectorAll("div#id_2");
|
|
124
208
|
element.addClass("booga").addClass("Booga2");
|
|
125
|
-
|
|
126
|
-
(0, chai_1.expect)(classdef).to.eq("booga Booga2");
|
|
209
|
+
let classdef = element.attr("class").value;
|
|
210
|
+
(0, chai_1.expect)(classdef).to.eq("blarg2 booga Booga2");
|
|
127
211
|
element.removeClass("booga2");
|
|
128
212
|
(0, chai_1.expect)(element.hasClass("booga2")).to.be.false;
|
|
129
213
|
(0, chai_1.expect)(element.hasClass("booga")).to.be.true;
|
|
130
214
|
});
|
|
215
|
+
(0, mocha_1.it)('must perform addClass and hasClass correctly 2', function () {
|
|
216
|
+
let probe1 = new mona_dish_1.DomQuery(document);
|
|
217
|
+
let element = probe1.querySelectorAll(".blarg2");
|
|
218
|
+
element.addClass("booga").addClass("Booga2");
|
|
219
|
+
let classdef = element.attr("class").value;
|
|
220
|
+
(0, chai_1.expect)(classdef).to.eq("blarg2 booga Booga2");
|
|
221
|
+
element.removeClass("booga2");
|
|
222
|
+
(0, chai_1.expect)(element.hasClass("booga2")).to.be.false;
|
|
223
|
+
(0, chai_1.expect)(element.hasClass("booga")).to.be.true;
|
|
224
|
+
(0, chai_1.expect)(element.hasClass("blarg2")).to.be.true;
|
|
225
|
+
});
|
|
226
|
+
(0, mocha_1.it)('must perform addClass and hasClass correctly 2', function () {
|
|
227
|
+
let probe1 = new mona_dish_1.DomQuery(document);
|
|
228
|
+
let element = probe1.querySelectorAll(".blarg2");
|
|
229
|
+
element.addClass("booga").addClass("Booga2");
|
|
230
|
+
(0, chai_1.expect)(probe1.querySelectorAll(".Booga2").length).eq(2);
|
|
231
|
+
});
|
|
131
232
|
(0, mocha_1.it)('must perform insert before and insert after correctly', function () {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
233
|
+
let probe1 = new mona_dish_1.DomQuery(document).querySelectorAll("#id_2");
|
|
234
|
+
let insert = mona_dish_1.DomQuery.fromMarkup("<div id='insertedBefore'></div><div id='insertedBefore2'></div>");
|
|
235
|
+
let insert2 = mona_dish_1.DomQuery.fromMarkup("<div id='insertedAfter'></div><div id='insertedAfter2'></div>");
|
|
135
236
|
probe1.insertBefore(insert);
|
|
136
237
|
probe1.insertAfter(insert2);
|
|
137
238
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("#insertedBefore").isPresent()).to.be.true;
|
|
@@ -141,25 +242,32 @@ var JSDOM = jsdom.JSDOM;
|
|
|
141
242
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("#insertedAfter2").isPresent()).to.be.true;
|
|
142
243
|
});
|
|
143
244
|
(0, mocha_1.it)('it must stream', function () {
|
|
144
|
-
|
|
145
|
-
|
|
245
|
+
let probe1 = new mona_dish_1.DomQuery(document).querySelectorAll("div");
|
|
246
|
+
let coll = probe1.stream.collect(new mona_dish_1.ArrayCollector());
|
|
146
247
|
(0, chai_1.expect)(coll.length == 4).to.be.true;
|
|
147
248
|
coll = probe1.lazyStream.collect(new mona_dish_1.ArrayCollector());
|
|
148
249
|
(0, chai_1.expect)(coll.length == 4).to.be.true;
|
|
149
250
|
});
|
|
251
|
+
(0, mocha_1.it)('it must stream to a domquery', function () {
|
|
252
|
+
let probe1 = new mona_dish_1.DomQuery(document).querySelectorAll("div");
|
|
253
|
+
let coll = probe1.stream.collect(new mona_dish_1.DomQueryCollector());
|
|
254
|
+
(0, chai_1.expect)(coll.length == 4).to.be.true;
|
|
255
|
+
coll = probe1.lazyStream.collect(new mona_dish_1.DomQueryCollector());
|
|
256
|
+
(0, chai_1.expect)(coll.length == 4).to.be.true;
|
|
257
|
+
});
|
|
150
258
|
(0, mocha_1.it)('it must have parents', function () {
|
|
151
|
-
|
|
152
|
-
|
|
259
|
+
let probe1 = new mona_dish_1.DomQuery(document).querySelectorAll("div");
|
|
260
|
+
let coll = probe1.parents("body").stream.collect(new mona_dish_1.ArrayCollector());
|
|
153
261
|
(0, chai_1.expect)(coll.length == 1).to.be.true;
|
|
154
262
|
});
|
|
155
263
|
(0, mocha_1.it)("must have a working insertBefore and insertAfter", function () {
|
|
156
|
-
|
|
157
|
-
probe1.insertBefore(mona_dish_1.DomQuery.fromMarkup(
|
|
158
|
-
probe1.insertAfter(mona_dish_1.DomQuery.fromMarkup(
|
|
264
|
+
let probe1 = new mona_dish_1.DomQuery(document).byId("id_2");
|
|
265
|
+
probe1.insertBefore(mona_dish_1.DomQuery.fromMarkup(` <div id="id_x_0"></div><div id="id_x_1"></div>`));
|
|
266
|
+
probe1.insertAfter(mona_dish_1.DomQuery.fromMarkup(` <div id="id_x_0_1"></div><div id="id_x_1_1"></div>`));
|
|
159
267
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("div").length).to.eq(8);
|
|
160
|
-
mona_dish_1.DomQuery.querySelectorAll("body").
|
|
268
|
+
mona_dish_1.DomQuery.querySelectorAll("body").innerHTML = trim(mona_dish_1.DomQuery.querySelectorAll("body").innerHTML.replace(/>\s*</gi, "><"));
|
|
161
269
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("body").childNodes.length).to.eq(8);
|
|
162
|
-
|
|
270
|
+
let innerHtml = mona_dish_1.DomQuery.querySelectorAll("body").innerHTML;
|
|
163
271
|
(0, chai_1.expect)(innerHtml.indexOf("id_x_0") < innerHtml.indexOf("id_x_1")).to.be.true;
|
|
164
272
|
(0, chai_1.expect)(innerHtml.indexOf("id_x_0") < innerHtml.indexOf("id_2")).to.be.true;
|
|
165
273
|
(0, chai_1.expect)(innerHtml.indexOf("id_x_0") > 0).to.be.true;
|
|
@@ -167,28 +275,50 @@ var JSDOM = jsdom.JSDOM;
|
|
|
167
275
|
(0, chai_1.expect)(innerHtml.indexOf("id_x_1_1") > innerHtml.indexOf("id_x_0_1")).to.be.true;
|
|
168
276
|
});
|
|
169
277
|
(0, mocha_1.it)("must have a working input handling", function () {
|
|
170
|
-
mona_dish_1.DomQuery.querySelectorAll("body").
|
|
171
|
-
|
|
172
|
-
|
|
278
|
+
mona_dish_1.DomQuery.querySelectorAll("body").innerHTML = `<form id="blarg">
|
|
279
|
+
<div id="embed1">
|
|
280
|
+
<input type="text" id="id_1" name="id_1" value="id_1_val">
|
|
281
|
+
<input type="text" id="id_2" name="id_2" value="id_2_val" disabled="disabled">
|
|
282
|
+
<textarea id="id_3" name="id_3">textareaVal</textarea>
|
|
283
|
+
|
|
284
|
+
<fieldset>
|
|
285
|
+
<input type="radio" id="mc" name="cc_1" value="Mastercard" checked="checked">
|
|
286
|
+
<label for="mc"> Mastercard</label>
|
|
287
|
+
<input type="radio" id="vi" name="cc_1" value="Visa">
|
|
288
|
+
<label for="vi"> Visa</label>
|
|
289
|
+
<input type="radio" id="ae" name="cc_1" value="AmericanExpress">
|
|
290
|
+
<label for="ae"> American Express</label>
|
|
291
|
+
</fieldset>
|
|
292
|
+
<select id="val_5" name="val_5" size="5">
|
|
293
|
+
<option>barg</option>
|
|
294
|
+
<option>jjj</option>
|
|
295
|
+
<option selected>akaka</option>
|
|
296
|
+
<option>blon</option>
|
|
297
|
+
<option>slashs</option>
|
|
298
|
+
</select>
|
|
299
|
+
</div>
|
|
300
|
+
</form>
|
|
301
|
+
`;
|
|
302
|
+
let length = mona_dish_1.DomQuery.querySelectorAll("form").elements.length;
|
|
173
303
|
(0, chai_1.expect)(length == 8).to.be.true;
|
|
174
|
-
|
|
304
|
+
let length1 = mona_dish_1.DomQuery.querySelectorAll("body").elements.length;
|
|
175
305
|
(0, chai_1.expect)(length1 == 8).to.be.true;
|
|
176
|
-
|
|
306
|
+
let length2 = mona_dish_1.DomQuery.byId("embed1").elements.length;
|
|
177
307
|
(0, chai_1.expect)(length2 == 8).to.be.true;
|
|
178
|
-
|
|
179
|
-
.stream.map(
|
|
180
|
-
.reduce(
|
|
308
|
+
let count = mona_dish_1.DomQuery.byId("embed1").elements
|
|
309
|
+
.stream.map(item => item.disabled ? 1 : 0)
|
|
310
|
+
.reduce((val1, val2) => val1 + val2, 0);
|
|
181
311
|
(0, chai_1.expect)(count.value).to.eq(1);
|
|
182
312
|
mona_dish_1.DomQuery.byId("embed1").elements
|
|
183
|
-
.stream.filter(
|
|
184
|
-
.each(
|
|
313
|
+
.stream.filter(item => item.disabled)
|
|
314
|
+
.each(item => item.disabled = false);
|
|
185
315
|
count = mona_dish_1.DomQuery.byId("embed1").elements
|
|
186
|
-
.stream.map(
|
|
187
|
-
.reduce(
|
|
316
|
+
.stream.map(item => item.disabled ? 1 : 0)
|
|
317
|
+
.reduce((val1, val2) => val1 + val2, 0);
|
|
188
318
|
(0, chai_1.expect)(count.value).to.eq(0);
|
|
189
319
|
count = mona_dish_1.DomQuery.byId("embed1").elements
|
|
190
|
-
.stream.map(
|
|
191
|
-
.reduce(
|
|
320
|
+
.stream.map(item => item.attr("checked").isPresent() ? 1 : 0)
|
|
321
|
+
.reduce((val1, val2) => val1 + val2, 0);
|
|
192
322
|
(0, chai_1.expect)(count.value).to.eq(1);
|
|
193
323
|
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").inputValue.value == "id_1_val").to.be.true;
|
|
194
324
|
mona_dish_1.DomQuery.byId("id_1").inputValue.value = "booga";
|
|
@@ -196,7 +326,7 @@ var JSDOM = jsdom.JSDOM;
|
|
|
196
326
|
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_3").inputValue.value).to.eq("textareaVal");
|
|
197
327
|
mona_dish_1.DomQuery.byId("id_3").inputValue.value = "hello world";
|
|
198
328
|
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_3").inputValue.value).to.eq("hello world");
|
|
199
|
-
|
|
329
|
+
let cfg = mona_dish_1.DomQuery.querySelectorAll("form").elements.encodeFormElement();
|
|
200
330
|
(0, chai_1.expect)(cfg.getIf("id_1").value[0]).to.eq("booga");
|
|
201
331
|
(0, chai_1.expect)(cfg.getIf("id_2").value[0]).to.eq("id_2_val");
|
|
202
332
|
(0, chai_1.expect)(cfg.getIf("id_3").value[0]).to.eq("hello world");
|
|
@@ -204,47 +334,71 @@ var JSDOM = jsdom.JSDOM;
|
|
|
204
334
|
(0, chai_1.expect)(cfg.getIf("val_5").value[0]).to.eq("akaka");
|
|
205
335
|
});
|
|
206
336
|
(0, mocha_1.it)("must have a proper loadScriptEval execution", function (done) {
|
|
207
|
-
mona_dish_1.DomQuery.byTagName("body").loadScriptEval("test.js");
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"content-type": "application/javascript",
|
|
211
|
-
}, "\n document.getElementById('id_1').innerHTML = \"hello world\";\n ");
|
|
212
|
-
setTimeout(function () {
|
|
213
|
-
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").innerHtml == "hello world").to.be.true;
|
|
337
|
+
mona_dish_1.DomQuery.byTagName("body").loadScriptEval("./fixtures/test.js");
|
|
338
|
+
setTimeout(() => {
|
|
339
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").innerHTML == "hello world").to.be.true;
|
|
214
340
|
done();
|
|
215
341
|
}, 100);
|
|
216
342
|
});
|
|
217
343
|
(0, mocha_1.it)("must have first etc working", function () {
|
|
218
344
|
(0, chai_1.expect)(mona_dish_1.DomQuery.querySelectorAll("div").first().id.value).to.eq("id_1");
|
|
219
345
|
});
|
|
220
|
-
(0, mocha_1.it)("runscript runcss", function () {
|
|
221
|
-
mona_dish_1.DomQuery.byTagName("body").
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
346
|
+
(0, mocha_1.it)("runscript runcss", function (done) {
|
|
347
|
+
mona_dish_1.DomQuery.byTagName("body").innerHTML = `
|
|
348
|
+
<div id="first"></div>
|
|
349
|
+
<div id="second"></div>
|
|
350
|
+
<div id="third"></div>
|
|
351
|
+
<div id="fourth"></div>
|
|
352
|
+
|
|
353
|
+
<script type="text/javascript">
|
|
354
|
+
document.getElementById("first").innerHTML = "hello world";
|
|
355
|
+
</script>
|
|
356
|
+
<script type="text/javascript">
|
|
357
|
+
//<![CDATA[
|
|
358
|
+
document.getElementById("second").innerHTML = "hello world";
|
|
359
|
+
//]]>
|
|
360
|
+
</script>
|
|
361
|
+
<script type="text/javascript">
|
|
362
|
+
<!--
|
|
363
|
+
document.getElementById("third").innerHTML = "hello world";
|
|
364
|
+
//-->
|
|
365
|
+
</script>
|
|
366
|
+
<script type="text/javascript">
|
|
367
|
+
//<!--
|
|
368
|
+
document.getElementById("fourth").innerHTML = "hello world";
|
|
369
|
+
//-->
|
|
370
|
+
</script>
|
|
371
|
+
|
|
372
|
+
<style>
|
|
373
|
+
#first {
|
|
374
|
+
border: 1px solid black;
|
|
375
|
+
}
|
|
376
|
+
</style>
|
|
377
|
+
`;
|
|
378
|
+
let content = mona_dish_1.DomQuery.byTagName("body").runScripts().runCss();
|
|
379
|
+
(0, chai_1.expect)(content.byId("first").innerHTML).to.eq("hello world");
|
|
380
|
+
(0, chai_1.expect)(content.byId("second").innerHTML).to.eq("hello world");
|
|
381
|
+
(0, chai_1.expect)(content.byId("third").innerHTML).to.eq("hello world");
|
|
382
|
+
(0, chai_1.expect)(content.byId("fourth").innerHTML).to.eq("hello world");
|
|
383
|
+
done();
|
|
227
384
|
});
|
|
385
|
+
//TODO defer does not work in jsdom
|
|
228
386
|
(0, mocha_1.it)("must have a proper loadScriptEval deferred", function (done) {
|
|
229
|
-
mona_dish_1.DomQuery.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
"content-type": "application/javascript",
|
|
233
|
-
}, "\n document.getElementById('id_1').innerHTML = \"hello world\";\n ");
|
|
234
|
-
setTimeout(function () {
|
|
235
|
-
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").innerHtml == "hello world").to.be.false;
|
|
387
|
+
mona_dish_1.DomQuery.byId(document.body).loadScriptEval("./fixtures/test2.js", 200);
|
|
388
|
+
setTimeout(() => {
|
|
389
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").innerHTML == "hello world").to.be.false;
|
|
236
390
|
}, 100);
|
|
237
|
-
setTimeout(
|
|
238
|
-
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").
|
|
391
|
+
setTimeout(() => {
|
|
392
|
+
(0, chai_1.expect)(mona_dish_1.DomQuery.byId("id_1").innerHTML == "hello world").to.be.true;
|
|
239
393
|
done();
|
|
240
|
-
},
|
|
394
|
+
}, 1500);
|
|
241
395
|
});
|
|
242
396
|
(0, mocha_1.it)("it must handle events properly", function () {
|
|
243
|
-
|
|
244
|
-
|
|
397
|
+
let clicked = 0;
|
|
398
|
+
let listener = () => {
|
|
245
399
|
clicked++;
|
|
246
400
|
};
|
|
247
|
-
|
|
401
|
+
let eventReceiver = mona_dish_1.DomQuery.byId("id_1");
|
|
248
402
|
eventReceiver.addEventListener("click", listener);
|
|
249
403
|
eventReceiver.click();
|
|
250
404
|
(0, chai_1.expect)(clicked).to.eq(1);
|
|
@@ -255,40 +409,147 @@ var JSDOM = jsdom.JSDOM;
|
|
|
255
409
|
(0, mocha_1.it)("it must handle innerText properly", function () {
|
|
256
410
|
//jsdom bug
|
|
257
411
|
Object.defineProperty(Object.prototype, 'innerText', {
|
|
258
|
-
get
|
|
412
|
+
get() {
|
|
259
413
|
return this.textContent;
|
|
260
414
|
},
|
|
261
415
|
});
|
|
262
|
-
|
|
263
|
-
probe.
|
|
416
|
+
let probe = mona_dish_1.DomQuery.byId("id_1");
|
|
417
|
+
probe.innerHTML = "<div>hello</div><div>world</div>";
|
|
264
418
|
(0, chai_1.expect)(probe.innerText()).to.eq("helloworld");
|
|
265
419
|
});
|
|
266
420
|
(0, mocha_1.it)("it must handle textContent properly", function () {
|
|
267
|
-
|
|
268
|
-
probe.
|
|
421
|
+
let probe = mona_dish_1.DomQuery.byId("id_1");
|
|
422
|
+
probe.innerHTML = "<div>hello</div><div>world</div>";
|
|
269
423
|
(0, chai_1.expect)(probe.textContent()).to.eq("helloworld");
|
|
270
424
|
});
|
|
271
425
|
(0, mocha_1.it)("it must handle iterations properly", function () {
|
|
272
|
-
|
|
273
|
-
|
|
426
|
+
let probe = mona_dish_1.DomQuery.byTagName("div");
|
|
427
|
+
let resArr = probe.lazyStream.collect(new mona_dish_1.ArrayCollector());
|
|
274
428
|
(0, chai_1.expect)(resArr.length).to.eq(4);
|
|
275
429
|
probe.reset();
|
|
276
430
|
while (probe.hasNext()) {
|
|
277
|
-
|
|
431
|
+
let el = probe.next();
|
|
278
432
|
(0, chai_1.expect)(el.tagName.value.toLowerCase()).to.eq("div");
|
|
279
433
|
}
|
|
280
434
|
(0, chai_1.expect)(probe.next()).to.eq(null);
|
|
281
|
-
|
|
435
|
+
let probe2 = mona_dish_1.DomQuery.byTagName("div").limits(2);
|
|
282
436
|
resArr = mona_dish_1.LazyStream.ofStreamDataSource(probe2).collect(new mona_dish_1.ArrayCollector());
|
|
283
437
|
(0, chai_1.expect)(resArr.length).to.eq(2);
|
|
284
438
|
});
|
|
285
439
|
(0, mocha_1.it)("it must handle subnodes properly", function () {
|
|
286
|
-
|
|
440
|
+
let probe = mona_dish_1.DomQuery.byTagName("div");
|
|
287
441
|
(0, chai_1.expect)(probe.subNodes(1, 3).length).to.eq(2);
|
|
288
442
|
probe = mona_dish_1.DomQuery.byTagName("body").childNodes.subNodes(0, 2);
|
|
289
443
|
(0, chai_1.expect)(probe.length).to.eq(2);
|
|
290
444
|
probe = mona_dish_1.DomQuery.byTagName("div").subNodes(2);
|
|
291
445
|
(0, chai_1.expect)(probe.length).to.eq(2);
|
|
292
446
|
});
|
|
447
|
+
(0, mocha_1.it)("it must ensure shadow dom creation works properly", function () {
|
|
448
|
+
let probe = mona_dish_1.DomQuery.byTagName("div");
|
|
449
|
+
try {
|
|
450
|
+
//probably not testable atm, mocha does not have shadow dom support
|
|
451
|
+
//we might be able to shim it in one way or the other
|
|
452
|
+
let element = probe.attachShadow();
|
|
453
|
+
(0, chai_1.expect)(element.length > 0).to.eq(true);
|
|
454
|
+
}
|
|
455
|
+
catch (e) {
|
|
456
|
+
//not supported we still need to get an error here
|
|
457
|
+
(0, chai_1.expect)(e.message.indexOf("not supported") != -1).to.be.true;
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
(0, mocha_1.it)('it must have a working wait for dom with mut observer and must detect condition after change', function () {
|
|
461
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
462
|
+
let probe = mona_dish_1.DomQuery.byId('id_1');
|
|
463
|
+
probe.innerHTML = 'true';
|
|
464
|
+
let ret = yield probe.waitUntilDom((element) => element.innerHTML.indexOf('true') != -1);
|
|
465
|
+
(0, chai_1.expect)(ret.isPresent());
|
|
466
|
+
probe = mona_dish_1.DomQuery.byId('bosushsdhs');
|
|
467
|
+
ret = yield probe.waitUntilDom((element) => element.isAbsent());
|
|
468
|
+
(0, chai_1.expect)(ret.isAbsent());
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
(0, mocha_1.it)('it must have a working wait for dom with mut observer', function () {
|
|
472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
473
|
+
let probe = mona_dish_1.DomQuery.byId('id_1');
|
|
474
|
+
setTimeout(() => probe.innerHTML = 'true', 300);
|
|
475
|
+
let ret = yield probe.waitUntilDom((element) => element.innerHTML.indexOf('true') != -1);
|
|
476
|
+
delete window.MutationObserver;
|
|
477
|
+
delete global.MutationObserver;
|
|
478
|
+
probe.innerHTML = "";
|
|
479
|
+
setTimeout(() => probe.innerHTML = 'true', 300);
|
|
480
|
+
let ret2 = yield probe.waitUntilDom((element) => element.innerHTML.indexOf('true') != -1);
|
|
481
|
+
(0, chai_1.expect)(ret.isPresent() && ret2.isPresent());
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
(0, mocha_1.it)('it must have a timeout', function () {
|
|
485
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
486
|
+
let probe = mona_dish_1.DomQuery.byId('booga');
|
|
487
|
+
try {
|
|
488
|
+
setTimeout(() => probe.innerHTML = 'true', 300);
|
|
489
|
+
yield probe.waitUntilDom((element) => element.innerHTML.indexOf('true') != -1);
|
|
490
|
+
chai_1.expect.fail("must have a timeout");
|
|
491
|
+
}
|
|
492
|
+
catch (ex) {
|
|
493
|
+
(0, chai_1.expect)(!!ex);
|
|
494
|
+
}
|
|
495
|
+
try {
|
|
496
|
+
delete window.MutationObserver;
|
|
497
|
+
delete global.MutationObserver;
|
|
498
|
+
probe.innerHTML = "";
|
|
499
|
+
setTimeout(() => probe.innerHTML = 'true', 300);
|
|
500
|
+
yield probe.waitUntilDom((element) => element.innerHTML.indexOf('true') != -1);
|
|
501
|
+
chai_1.expect.fail("must have a timeout");
|
|
502
|
+
}
|
|
503
|
+
catch (ex2) {
|
|
504
|
+
(0, chai_1.expect)(!!ex2);
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
(0, mocha_1.it)('must handle null inputs correctly', function () {
|
|
509
|
+
const dq = new mona_dish_1.DomQuery(null);
|
|
510
|
+
(0, chai_1.expect)(dq.isAbsent()).to.eq(true);
|
|
511
|
+
});
|
|
512
|
+
(0, mocha_1.it)('concat must work as expected resulting', function () {
|
|
513
|
+
let probe = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
514
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("body");
|
|
515
|
+
let result = probe.concat(probe2);
|
|
516
|
+
(0, chai_1.expect)(result.length).to.eq(probe.length + probe2.length);
|
|
517
|
+
//lets now check for filter double
|
|
518
|
+
probe2 = mona_dish_1.DomQuery.querySelectorAll('div');
|
|
519
|
+
result = probe.concat(probe2);
|
|
520
|
+
(0, chai_1.expect)(result.length).to.eq(probe.length);
|
|
521
|
+
});
|
|
522
|
+
(0, mocha_1.it)('must handle match correctly', function () {
|
|
523
|
+
let probe = mona_dish_1.DomQuery.querySelectorAll("div").first();
|
|
524
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("body").first();
|
|
525
|
+
(0, chai_1.expect)(probe.matchesSelector("div")).to.eq(true);
|
|
526
|
+
(0, chai_1.expect)(probe2.matchesSelector("body")).to.eq(true);
|
|
527
|
+
(0, chai_1.expect)(probe2.matchesSelector("div")).to.eq(false);
|
|
528
|
+
});
|
|
529
|
+
(0, mocha_1.it)('must by recycleable', function () {
|
|
530
|
+
let probe = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
531
|
+
let res1 = probe.filter(item => item.matchesSelector("div"));
|
|
532
|
+
(0, chai_1.expect)(res1.length).to.eq(4);
|
|
533
|
+
let res2 = probe.filter(item => item.matchesSelector("div"));
|
|
534
|
+
(0, chai_1.expect)(res2.length).to.eq(4);
|
|
535
|
+
});
|
|
536
|
+
(0, mocha_1.it)('delete must work', function () {
|
|
537
|
+
let probe = mona_dish_1.DomQuery.querySelectorAll("body");
|
|
538
|
+
let probe2 = mona_dish_1.DomQuery.fromMarkup("<div id='deleteprobe1'>snafu</div>");
|
|
539
|
+
probe2.appendTo(probe);
|
|
540
|
+
(0, chai_1.expect)(probe.querySelectorAll("#deleteprobe1").isPresent()).to.eq(true);
|
|
541
|
+
probe2.delete();
|
|
542
|
+
(0, chai_1.expect)(probe.querySelectorAll("#deleteprobe1").isAbsent()).to.eq(true);
|
|
543
|
+
});
|
|
544
|
+
(0, mocha_1.it)('must work with rxjs and domquery', function () {
|
|
545
|
+
let probe = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
546
|
+
let probe2 = mona_dish_1.DomQuery.querySelectorAll("div");
|
|
547
|
+
let probeCnt = 0;
|
|
548
|
+
let probe2Cnt = 0;
|
|
549
|
+
(0, rxjs_1.from)(probe).subscribe(() => probeCnt++);
|
|
550
|
+
(0, rxjs_1.from)(probe2.stream).subscribe(() => probe2Cnt++);
|
|
551
|
+
(0, chai_1.expect)(probeCnt).to.be.above(0);
|
|
552
|
+
(0, chai_1.expect)(probeCnt).to.eq(probe2Cnt);
|
|
553
|
+
});
|
|
293
554
|
});
|
|
294
555
|
//# sourceMappingURL=DomQueryTest.spec.js.map
|