jsf.js_next_gen 4.0.0-beta-18 → 4.0.0-beta-19

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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/main/typescript/@types/definitions/index.d.ts +14 -40
  3. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -8
  4. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -9
  5. package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +0 -2
  6. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +8 -16
  7. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +2 -2
  8. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +0 -25
  9. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -22
  10. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +4 -5
  11. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +6 -15
  12. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +6 -16
  13. package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +0 -1
  14. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +4 -4
  15. package/target/test/impl/ImplTest.spec.js +3 -5
  16. package/target/test/impl/ImplTest.spec.js.map +1 -1
  17. package/target/test/impl/ImplTest_23.spec.js +3 -6
  18. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  19. package/target/test/impl/SeparatorCharsTest.spec.js +0 -2
  20. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  21. package/target/test/xhrCore/EventTests.spec.js +7 -12
  22. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  23. package/target/test/xhrCore/FakeWebsocket.js +2 -2
  24. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  25. package/target/test/xhrCore/FileUploadTest.spec.js +0 -10
  26. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  27. package/target/test/xhrCore/RequestParamsTest.spec.js +0 -18
  28. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  29. package/target/test/xhrCore/RequestTest_23.spec.js +2 -3
  30. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  31. package/target/test/xhrCore/ResponseTest.spec.js +6 -7
  32. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  33. package/target/test/xhrCore/ResponseTest23.spec.js +6 -7
  34. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  35. package/target/test/xhrCore/ShadowDomTest.spec.js +0 -1
  36. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  37. package/target/test/xhrCore/WebsocketTest.js +4 -4
  38. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsf.js_next_gen",
3
- "version": "4.0.0-beta-18",
3
+ "version": "4.0.0-beta-19",
4
4
  "description": "A next generation typescript reimplementation of jsf.js",
5
5
  "main": "dist/window/faces.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- /* Licensed to the Apache Software Foundation (ASF) under one or more
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
2
  * contributor license agreements. See the NOTICE file distributed with
3
3
  * this work for additional information regarding copyright ownership.
4
4
  * The ASF licenses this file to you under the Apache License, Version 2.0
@@ -17,29 +17,18 @@
17
17
  /**
18
18
  * Basic internal types used
19
19
  *
20
- * This file is only to eliminate various any calls into
21
- * window, jsf and myfaces and make also the calls into
22
- * the apis from a an extended window context in a type safe
23
- * way
24
- *
25
- * We use this trick to map the types into the modules
26
- * which we need to produce proper jsdoc files
20
+ * This file is only there to allow global calls into window, faces and ajax
21
+ * in a typesafe manner, hence eliminating <b>any</b> casts.
27
22
  */
28
23
  declare global {
29
24
 
30
- type Producer<T> = () => T;
31
25
  type Consumer<T> = (s?: T) => void;
32
- type Runnable = () => any;
33
- type Transformable<S, T> = (s: S) => T;
34
-
35
26
  type AssocArr<T> = { [key: string]: T };
36
-
37
27
  type EvalFuncs = Array<Function | string>;
38
28
  type Options = { [key: string]: string | Function | { [key: string]: string | Function } };
39
29
  type Context = AssocArr<any>;
40
30
  type ElemDef = Element | string;
41
31
 
42
-
43
32
  /**
44
33
  * * <ul>
45
34
  * <li> errorData.type : &quot;error&quot;</li>
@@ -58,7 +47,6 @@ declare global {
58
47
  serverErrorName: string;
59
48
  serverErrorMessage: string;
60
49
  source: any;
61
-
62
50
  responseCode: string;
63
51
  responseText: string;
64
52
  responseXML: string;
@@ -74,29 +62,8 @@ declare global {
74
62
  source: any;
75
63
  }
76
64
 
77
- /*! Licensed to the Apache Software Foundation (ASF) under one or more
78
- * contributor license agreements. See the NOTICE file distributed with
79
- * this work for additional information regarding copyright ownership.
80
- * The ASF licenses this file to you under the Apache License, Version 2.0
81
- * (the "License"); you may not use this file except in compliance with
82
- * the License. You may obtain a copy of the License at
83
- *
84
- * http://www.apache.org/licenses/LICENSE-2.0
85
- *
86
- * Unless required by applicable law or agreed to in writing, software
87
- * distributed under the License is distributed on an "AS IS" BASIS,
88
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
- * See the License for the specific language governing permissions and
90
- * limitations under the License.
91
- */
92
-
93
- /**
94
- * interface definitions to make the code more compiler typesafe
95
- */
96
-
97
65
  interface Ajax {
98
66
  request(element: Element, event?: Event, options?: Context): void;
99
-
100
67
  response(request: XMLHttpRequest, context?: Context): void;
101
68
  }
102
69
 
@@ -113,13 +80,10 @@ declare global {
113
80
  onclose: Function,
114
81
  behaviorScripts: any,
115
82
  autoconnect: boolean): void;
116
-
117
83
  open(socketClientId: string);
118
-
119
84
  close(socketClientId: string): void;
120
85
  }
121
86
 
122
-
123
87
  interface FacesAPI {
124
88
  contextpath: string;
125
89
  specversion: number;
@@ -155,10 +119,18 @@ declare global {
155
119
  };
156
120
  }
157
121
 
122
+ /*
123
+ * Global namespaces type definitions
124
+ */
158
125
  let myfaces: MyFacesAPI;
159
126
  let jsf: FacesAPI;
160
127
  let faces: FacesAPI;
161
- // special trick, the typscript compiler treats window as Window
128
+
129
+ // special "magic", Typescript merges whatever we have
130
+ // to window. This is a language "hack", but documented.
131
+ // see https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
132
+ // lib.dom.d.ts declares the type Window as being type for window.
133
+ // noinspection JSUnusedGlobalSymbols
162
134
  interface Window {
163
135
  myfaces: MyFacesAPI,
164
136
  faces: FacesAPI,
@@ -167,7 +139,9 @@ declare global {
167
139
  called: { [key: string]: any }
168
140
  }
169
141
  }
142
+
170
143
  // this is needed to tell the compiler that we have an ambient
171
144
  // module, otherwise the global overload would produce an error
145
+ // https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
172
146
  // noinspection JSUnusedGlobalSymbols
173
147
  export var __my_faces_ambient_module_glob_;
@@ -14,16 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {Config} from "mona-dish";
17
+ import {Config, DomQuery} from "mona-dish";
18
18
  import {describe, it} from 'mocha';
19
19
  import {expect} from 'chai';
20
20
  import * as sinon from 'sinon';
21
21
 
22
- import {DomQuery} from "mona-dish";
23
-
24
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
25
- import defaultMyFaces = StandardInits.defaultMyFaces;
26
23
  import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
24
+ import defaultMyFaces = StandardInits.defaultMyFaces;
27
25
 
28
26
 
29
27
  sinon.reset();
@@ -48,8 +46,7 @@ describe('faces.ajax.request test suite', () => {
48
46
  //we stub the addRequestToQueue, to enable the request check only
49
47
  //without any xhr and response, both will be tested separately for
50
48
  //proper behavior
51
- const Impl = Implementation;
52
- const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
49
+ const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
53
50
  //now the faces.ajax.request should trigger but should not go into
54
51
  //the asynchronous event loop.
55
52
  //lets check it out
@@ -61,8 +58,6 @@ describe('faces.ajax.request test suite', () => {
61
58
 
62
59
  expect(addRequestToQueue.called).to.be.true;
63
60
  expect(addRequestToQueue.callCount).to.eq(1);
64
-
65
- const argElement = <Config>addRequestToQueue.args[0][2];
66
61
  const context = (<Config>addRequestToQueue.args[0][2]);
67
62
 
68
63
  expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
@@ -14,13 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {Config} from "mona-dish";
17
+ import {Config, DomQuery} from "mona-dish";
18
18
  import {describe, it} from 'mocha';
19
19
  import {expect} from 'chai';
20
20
  import * as sinon from 'sinon';
21
21
 
22
- import {DomQuery} from "mona-dish";
23
-
24
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
25
23
  import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
26
24
  import defaultMyFaces23 = StandardInits.defaultMyFaces23;
@@ -41,16 +39,14 @@ declare var Implementation: any;
41
39
  describe('javax.ajax.request test suite', () => {
42
40
 
43
41
  beforeEach(async () => {
44
- let ret = await defaultMyFaces23();
45
- return ret;
42
+ return await defaultMyFaces23();
46
43
  });
47
44
 
48
45
  it("jsf.ajax.request can be called", () => {
49
46
  //we stub the addRequestToQueue, to enable the request check only
50
47
  //without any xhr and response, both will be tested separately for
51
48
  //proper behavior
52
- const Impl = Implementation;
53
- const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
49
+ const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
54
50
  //now the javax.ajax.request should trigger but should not go into
55
51
  //the asynchronous event loop.
56
52
  //lets check it out
@@ -62,8 +58,6 @@ describe('javax.ajax.request test suite', () => {
62
58
 
63
59
  expect(addRequestToQueue.called).to.be.true;
64
60
  expect(addRequestToQueue.callCount).to.eq(1);
65
-
66
- const argElement = <Config>addRequestToQueue.args[0][2];
67
61
  const context = (<Config>addRequestToQueue.args[0][2]);
68
62
 
69
63
  expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
@@ -21,8 +21,6 @@ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
21
21
  import defaultMyFaces = StandardInits.defaultMyFaces;
22
22
  import defaultSeparatorChar = StandardInits.defaultSeparatorChar;
23
23
 
24
- const jsdom = require("jsdom");
25
- const {JSDOM} = jsdom;
26
24
  sinon.reset();
27
25
 
28
26
  declare var faces: any;
@@ -28,6 +28,7 @@ declare var faces: any;
28
28
 
29
29
  describe('tests the addOnEvent and addOnError handling', function () {
30
30
 
31
+ // noinspection DuplicatedCode
31
32
  beforeEach(async function () {
32
33
  let waitForResult = protocolPage();
33
34
  return waitForResult.then((close) => {
@@ -36,7 +37,7 @@ describe('tests the addOnEvent and addOnError handling', function () {
36
37
  this.requests = [];
37
38
 
38
39
  this.respond = (response: string): XMLHttpRequest => {
39
- let xhrReq = this.requests.shift();
40
+ let xhrReq = (this.requests as Array<any>).shift();
40
41
  xhrReq.responsetype = "text/xml";
41
42
  xhrReq.respond(200, {'Content-Type': 'text/xml'}, response);
42
43
  return xhrReq;
@@ -59,13 +60,6 @@ describe('tests the addOnEvent and addOnError handling', function () {
59
60
  afterEach(function () {
60
61
  this.closeIt();
61
62
  });
62
-
63
- let allowedStati = {
64
- "begin": true,
65
- "complete": true,
66
- "success": true,
67
- };
68
-
69
63
  it("must have a global add on event call with all three phases passed", function () {
70
64
  let onEventCalled1 = 0;
71
65
  let onEventCalled2 = 0;
@@ -82,11 +76,10 @@ describe('tests the addOnEvent and addOnError handling', function () {
82
76
  throw ("Wrong status")
83
77
  }
84
78
  });
85
- faces.ajax.addOnEvent((data: any) => {
79
+ faces.ajax.addOnEvent(() => {
86
80
  onEventCalled2++;
87
-
88
81
  });
89
- let issuer = DQ.byId("cmd_update_insert").click();
82
+ DQ.byId("cmd_update_insert").click();
90
83
  this.respond(XmlResponses.UPDATE_INSERT_1);
91
84
 
92
85
  expect(onEventCalled1).to.eq(3);
@@ -104,12 +97,12 @@ describe('tests the addOnEvent and addOnError handling', function () {
104
97
  errorMessage = data.errorMessage;
105
98
  onErrorCalled1++
106
99
  });
107
- faces.ajax.addOnError((data: any) => {
100
+ faces.ajax.addOnError(() => {
108
101
  onErrorCalled2++;
109
102
  });
110
103
 
111
104
  //cmd_error_component
112
- let issuer = DQ.byId("cmd_error_component").click();
105
+ DQ.byId("cmd_error_component").click();
113
106
  this.respond(XmlResponses.ERROR_2);
114
107
 
115
108
  expect(onErrorCalled1).to.eq(1);
@@ -119,7 +112,6 @@ describe('tests the addOnEvent and addOnError handling', function () {
119
112
  });
120
113
 
121
114
  it("must have an id set if there is an emitting element", function () {
122
- let onEventCalled1 = 0;
123
115
  let onEventCalled2 = 0;
124
116
 
125
117
  let assertSourceExists = (data: any) => {
@@ -129,11 +121,11 @@ describe('tests the addOnEvent and addOnError handling', function () {
129
121
  faces.ajax.addOnEvent((data: any) => {
130
122
  assertSourceExists(data);
131
123
  });
132
- faces.ajax.addOnEvent((data: any) => {
124
+ faces.ajax.addOnEvent(() => {
133
125
  onEventCalled2++;
134
126
 
135
127
  });
136
- let issuer = DQ.byId("cmd_update_insert").click();
128
+ DQ.byId("cmd_update_insert").click();
137
129
  this.respond(XmlResponses.UPDATE_INSERT_1);
138
130
 
139
131
  });
@@ -19,14 +19,14 @@ export class FakeWebsocket {
19
19
  onmessage: Function = () => {}
20
20
  onclose: Function = () => {}
21
21
 
22
- constructor(data?: any) {
22
+ constructor() {
23
23
  setTimeout(() => {
24
24
  this.onopen();
25
25
  }, 10);
26
26
  }
27
27
 
28
28
 
29
- send(msg: any) {
29
+ send() {
30
30
  }
31
31
 
32
32
  _respond(response: any) {
@@ -18,33 +18,10 @@ import * as sinon from "sinon";
18
18
  import {expect} from "chai";
19
19
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
20
20
  import {DomQuery} from "mona-dish";
21
- import {
22
- COMPLETE,
23
- P_AJAX,
24
- P_EXECUTE,
25
- P_PARTIAL_SOURCE,
26
- P_RENDER,
27
- P_VIEWSTATE,
28
- P_WINDOW_ID,
29
- SUCCESS
30
- } from "../../impl/core/Const";
31
- import defaultMyFaces = StandardInits.defaultMyFaces;
32
- import STD_XML = StandardInits.STD_XML;
33
21
  import defaultFileForm = StandardInits.defaultFileForm;
34
22
  import {Implementation} from "../../impl/AjaxImpl";
35
23
 
36
24
  declare var faces: any;
37
- declare var Impl
38
-
39
-
40
- let issueStdReq = function (element) {
41
- faces.ajax.request(element, null, {
42
- execute: "input_1",
43
- render: "@form",
44
- pass1: "pass1",
45
- pass2: "pass2"
46
- });
47
- };
48
25
 
49
26
  /**
50
27
  * specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
@@ -87,7 +64,6 @@ describe('Tests on the xhr core when it starts to call the request', function ()
87
64
  it('must have sent a form multipart request', function (done) {
88
65
  let send = sinon.spy(XMLHttpRequest.prototype, "send");
89
66
  const CONTENT_TYPE = "Content-Type";
90
- const MULTIPART_FORM = "multipart/form-data";
91
67
  const POST = "POST";
92
68
 
93
69
  try {
@@ -119,7 +95,6 @@ describe('Tests on the xhr core when it starts to call the request', function ()
119
95
  let send = sinon.spy(XMLHttpRequest.prototype, "send");
120
96
 
121
97
  const CONTENT_TYPE = "Content-Type";
122
- const MULTIPART_FORM = "multipart/form-data";
123
98
  const POST = "POST";
124
99
 
125
100
  try {
@@ -16,23 +16,13 @@
16
16
  import * as sinon from "sinon";
17
17
  import {Implementation} from "../../impl/AjaxImpl";
18
18
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
19
- import defaultMyFaces = StandardInits.defaultMyFaces;
19
+
20
20
  import protocolPage = StandardInits.protocolPage;
21
21
  import {DQ} from "mona-dish";
22
22
  import {XhrFormData} from "../../impl/xhrCore/XhrFormData";
23
23
  import { expect } from "chai";
24
24
 
25
25
  describe("test for proper request param patterns identical to the old implementation", function () {
26
- const DELETE_PATTERN = {
27
- op: "delete1",
28
- "jakarta.faces.source": "cmd_delete",
29
- "jakarta.faces.partial.event": "click",
30
- "jakarta.faces.partial.ajax": "true",
31
- "jakarta.faces.partial.execute": "cmd_delete",
32
- "form1": "form1",
33
- "jakarta.faces.ViewState": "blubbblubblubb"
34
- }
35
-
36
26
  const UPDATE_INSERT_2 = {
37
27
  "op": "updateinsert2",
38
28
  "jakarta.faces.partial.event": "click",
@@ -42,17 +32,6 @@ describe("test for proper request param patterns identical to the old implementa
42
32
  "form1": "form1",
43
33
  "jakarta.faces.ViewState": "blubbblubblubb"
44
34
  }
45
-
46
- const ERRORS = {
47
- "op": "errors",
48
- "jakarta.faces.partial.event": "click",
49
- "jakarta.faces.source": "cmd_error",
50
- "jakarta.faces.partial.ajax": "true",
51
- "jakarta.faces.partial.execute": "cmd_error",
52
- "form1": "form1",
53
- "jakarta.faces.ViewState": "blubbblubblubb"
54
- }
55
-
56
35
  /**
57
36
  * matches two maps for absolute identicality
58
37
  */
@@ -57,9 +57,9 @@ function remapNamespacesFor23() {
57
57
 
58
58
 
59
59
  let {
60
- P_PARTIAL_SOURCE, P_VIEWSTATE, P_VIEWROOT, P_VIEWHEAD, P_VIEWBODY,
61
- P_AJAX, P_EXECUTE, P_RENDER, P_EVT, P_CLIENT_WINDOW, P_RESET_VALUES,
62
- P_WINDOW_ID, ENCODED_URL
60
+ P_PARTIAL_SOURCE, P_VIEWSTATE,
61
+ P_AJAX, P_EXECUTE, P_RENDER,
62
+ P_WINDOW_ID
63
63
  } = remapNamespacesFor23();
64
64
 
65
65
 
@@ -232,7 +232,7 @@ describe('Tests after core when it hits response', function () {
232
232
  render: "@form",
233
233
  pass1: "pass1",
234
234
  pass2: "pass2",
235
- onevent: (evt: any) => {
235
+ onevent: () => {
236
236
  localCnt++;
237
237
  }
238
238
  });
@@ -325,7 +325,6 @@ describe('Tests after core when it hits response', function () {
325
325
  let xhrReq = null;
326
326
 
327
327
  try {
328
- let errorCnt = 0;
329
328
  let element = DomQuery.byId("input_2").getAsElem(0).value;
330
329
  jsf.ajax.request(element, null, {
331
330
  execute: "input_1",
@@ -21,9 +21,8 @@ import * as sinon from "sinon";
21
21
 
22
22
  import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
23
23
  import {expect} from "chai";
24
- import protocolPage = StandardInits.protocolPage;
25
24
  import {DQ} from "mona-dish";
26
- import {Optional} from "mona-dish";
25
+ import protocolPage = StandardInits.protocolPage;
27
26
 
28
27
  declare var faces: any;
29
28
  declare var Implementation: any;
@@ -70,8 +69,7 @@ describe('Tests of the various aspects of the response protocol functionality',
70
69
 
71
70
  it("must have a simple field updated as well as the viewstate", function (done) {
72
71
  //DQ.byId("cmd_update_insert").click();
73
- let issuer = DQ.byId("cmd_update_insert").click();
74
-
72
+ DQ.byId("cmd_update_insert").click();
75
73
  this.respond(XmlResponses.UPDATE_INSERT_1);
76
74
 
77
75
  expect(DQ.byId("changesArea")
@@ -102,8 +100,7 @@ describe('Tests of the various aspects of the response protocol functionality',
102
100
 
103
101
  it("must have a simple field updated with the second before update rendering path", function (done) {
104
102
  //DQ.byId("cmd_update_insert").click();
105
- let issuer = DQ.byId("cmd_update_insert").click();
106
-
103
+ DQ.byId("cmd_update_insert").click();
107
104
  this.respond(XmlResponses.UPDATE_INSERT_2);
108
105
 
109
106
  expect(DQ.byId("changesArea")
@@ -158,7 +155,6 @@ describe('Tests of the various aspects of the response protocol functionality',
158
155
  this.respond(XmlResponses.HEAD_REPLACEMENT);
159
156
 
160
157
  //basic replacement
161
- let newHead = DQ.byId(document.head);
162
158
  let newBody = DQ.byId(document.body);
163
159
  let newContent = <string>newBody.html().value;
164
160
 
@@ -219,8 +215,7 @@ describe('Tests of the various aspects of the response protocol functionality',
219
215
  });
220
216
 
221
217
  it("must have processed a proper eval of a script given in the eval tag", function () {
222
- let issuer = DQ.byId("cmd_eval").click();
223
-
218
+ DQ.byId("cmd_eval").click();
224
219
  this.respond(XmlResponses.EVAL_1);
225
220
 
226
221
  let resultHTML: string = <string>DQ.byId(document.body).html().value;
@@ -229,9 +224,7 @@ describe('Tests of the various aspects of the response protocol functionality',
229
224
  });
230
225
 
231
226
  it("must have updated the viewstates properly", function () {
232
-
233
- let issuer = DQ.byId("cmd_eval").click();
234
-
227
+ DQ.byId("cmd_eval").click();
235
228
  /*js full submit form, coming from the integration tests*/
236
229
  window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
237
230
  enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
@@ -266,9 +259,7 @@ describe('Tests of the various aspects of the response protocol functionality',
266
259
 
267
260
 
268
261
  it("must have updated the viewstates properly with lenient update block", function () {
269
-
270
- let issuer = DQ.byId("cmd_eval").click();
271
-
262
+ DQ.byId("cmd_eval").click();
272
263
  /*js full submit form, coming from the integration tests*/
273
264
  window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
274
265
  enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
@@ -6,7 +6,7 @@
6
6
  * the License. You may obtain a copy of the License at
7
7
  *
8
8
  * http://www.apache.org/licenses/LICENSE-2.0
9
- *
9
+
10
10
  * Unless required by applicable law or agreed to in writing, software
11
11
  * distributed under the License is distributed on an "AS IS" BASIS,
12
12
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -72,10 +72,7 @@ describe('Tests of the various aspects of the response protocol functionality',
72
72
 
73
73
  it("must have a simple field updated as well as the viewstate", function (done) {
74
74
  //DQ.byId("cmd_update_insert").click();
75
-
76
-
77
- let issuer = DQ.byId("cmd_update_insert").click();
78
-
75
+ DQ.byId("cmd_update_insert").click();
79
76
  this.respond(XmlResponses.UPDATE_INSERT_1);
80
77
 
81
78
  expect(DQ.byId("changesArea")
@@ -106,8 +103,7 @@ describe('Tests of the various aspects of the response protocol functionality',
106
103
 
107
104
  it("must have a simple field updated with the second before update rendering path", function (done) {
108
105
  //DQ.byId("cmd_update_insert").click();
109
- let issuer = DQ.byId("cmd_update_insert").click();
110
-
106
+ DQ.byId("cmd_update_insert").click();
111
107
  this.respond(XmlResponses.UPDATE_INSERT_2);
112
108
 
113
109
  expect(DQ.byId("changesArea")
@@ -162,7 +158,6 @@ describe('Tests of the various aspects of the response protocol functionality',
162
158
  this.respond(XmlResponses.HEAD_REPLACEMENT);
163
159
 
164
160
  //basic replacement
165
- let newHead = DQ.byId(document.head);
166
161
  let newBody = DQ.byId(document.body);
167
162
  let newContent = <string>newBody.html().value;
168
163
 
@@ -223,8 +218,7 @@ describe('Tests of the various aspects of the response protocol functionality',
223
218
  });
224
219
 
225
220
  it("must have processed a proper eval of a script given in the eval tag", function () {
226
- let issuer = DQ.byId("cmd_eval").click();
227
-
221
+ DQ.byId("cmd_eval").click();
228
222
  this.respond(XmlResponses.EVAL_1);
229
223
 
230
224
  let resultHTML: string = <string>DQ.byId(document.body).html().value;
@@ -233,9 +227,7 @@ describe('Tests of the various aspects of the response protocol functionality',
233
227
  });
234
228
 
235
229
  it("must have updated the viewstates properly", function () {
236
-
237
- let issuer = DQ.byId("cmd_eval").click();
238
-
230
+ DQ.byId("cmd_eval").click();
239
231
  /*js full submit form, coming from the integration tests*/
240
232
  window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
241
233
  enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
@@ -270,9 +262,7 @@ describe('Tests of the various aspects of the response protocol functionality',
270
262
 
271
263
 
272
264
  it("must have updated the viewstates properly with lenient update block", function () {
273
-
274
- let issuer = DQ.byId("cmd_eval").click();
275
-
265
+ DQ.byId("cmd_eval").click();
276
266
  /*js full submit form, coming from the integration tests*/
277
267
  window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
278
268
  enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
@@ -84,7 +84,6 @@ describe('shadow dom testsuite', () => {
84
84
 
85
85
 
86
86
  it("shadow dom updated triggered from outside", function() {
87
- const Impl = Implementation;
88
87
  //const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
89
88
 
90
89
  expect(DomQuery.querySelectorAll("#shadowDomArea").length).to.eq(1);
@@ -126,13 +126,13 @@ describe('Tests the jsf websocket client side api on high level (generic test wi
126
126
 
127
127
  let msg = null;
128
128
  let cnl = null;
129
- new Promise((resolve, reject) => {
129
+ new Promise((resolve) => {
130
130
  faces.push.init("blarg", "booga.ws", "mychannel", () => {
131
131
  openCalled = true;
132
132
  this.fakeWebsocket._respond({data: '"booga"'});
133
133
  },
134
134
 
135
- (message: string, channel: string, event: any) => {
135
+ (message: string, channel: string) => {
136
136
  messageCalled = true;
137
137
  msg = message;
138
138
  cnl = channel;
@@ -174,13 +174,13 @@ describe('Tests the jsf websocket client side api on high level (generic test wi
174
174
 
175
175
  let msg = null;
176
176
  let cnl = null;
177
- new Promise((resolve, reject) => {
177
+ new Promise((resolve) => {
178
178
  faces.push.init("blarg", "booga.ws", "mychannel", () => {
179
179
  openCalled = true;
180
180
  this.fakeWebsocket._respond({data: '"booga"'});
181
181
  },
182
182
 
183
- (message: string, channel: string, event: any) => {
183
+ (message: string, channel: string) => {
184
184
  messageCalled = true;
185
185
  msg = message;
186
186
  cnl = channel;
@@ -47,13 +47,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
47
47
  });
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
+ const mona_dish_1 = require("mona-dish");
50
51
  const mocha_1 = require("mocha");
51
52
  const chai_1 = require("chai");
52
53
  const sinon = __importStar(require("sinon"));
53
- const mona_dish_1 = require("mona-dish");
54
54
  const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
55
- var defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
56
55
  const Const_1 = require("../../impl/core/Const");
56
+ var defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
57
57
  sinon.reset();
58
58
  /**
59
59
  * testing the faces.ajax.request api without triggering any
@@ -69,8 +69,7 @@ sinon.reset();
69
69
  //we stub the addRequestToQueue, to enable the request check only
70
70
  //without any xhr and response, both will be tested separately for
71
71
  //proper behavior
72
- const Impl = Implementation;
73
- const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
72
+ const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
74
73
  //now the faces.ajax.request should trigger but should not go into
75
74
  //the asynchronous event loop.
76
75
  //lets check it out
@@ -80,7 +79,6 @@ sinon.reset();
80
79
  }).click();
81
80
  (0, chai_1.expect)(addRequestToQueue.called).to.be.true;
82
81
  (0, chai_1.expect)(addRequestToQueue.callCount).to.eq(1);
83
- const argElement = addRequestToQueue.args[0][2];
84
82
  const context = addRequestToQueue.args[0][2];
85
83
  (0, chai_1.expect)(context.getIf("passThrgh", Const_1.P_RENDER).value).eq("@all");
86
84
  //Execute issuing form due to @form and always the issuing element