You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2020/04/17 09:50:39 UTC
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#68: migrate QUnit tests to Jasmine
henningn commented on a change in pull request #68: migrate QUnit tests to Jasmine
URL: https://github.com/apache/myfaces-tobago/pull/68#discussion_r410079332
##########
File path: tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/Collapsible_Box.test.js
##########
@@ -15,306 +15,206 @@
* limitations under the License.
*/
-import {testFrameQuerySelectorAllFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
-import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
-
-QUnit.test("Simple Collapsible Box: show -> hide transition", function (assert) {
- let showFn = testFrameQuerySelectorFn("#page\\:mainForm\\:controller\\:show");
- let hideFn = testFrameQuerySelectorFn("#page\\:mainForm\\:controller\\:hide");
- let contentFn = testFrameQuerySelectorFn("#page\\:mainForm\\:controller\\:content");
-
- let TTT = new TobagoTestTool(assert);
- TTT.action(function () {
- showFn().dispatchEvent(new Event("click", {bubbles: true}));
- });
- TTT.waitForResponse();
- TTT.asserts(1, function () {
- assert.ok(contentFn() !== null);
- });
- TTT.action(function () {
- hideFn().dispatchEvent(new Event("click", {bubbles: true}));
- });
- TTT.waitForResponse();
- TTT.asserts(1, function () {
- assert.equal(contentFn(), null);
- });
- TTT.startTest();
+import {querySelectorAllFn, querySelectorFn} from "/script/tobago-test.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
+
+it("Simple Collapsible Box: show -> hide transition", function (done) {
+ let showFn = querySelectorFn("#page\\:mainForm\\:controller\\:show");
+ let hideFn = querySelectorFn("#page\\:mainForm\\:controller\\:hide");
+ let contentFn = querySelectorFn("#page\\:mainForm\\:controller\\:content");
+
+ let test = new JasmineTestTool(done);
+ test.do(() => showFn().dispatchEvent(new Event("click", {bubbles: true})));
+ test.wait(() => contentFn() && contentFn() !== null);
+ test.do(() => expect(contentFn !== null).toBe(true));
Review comment:
The contentFn is not executed. Use _contentFn()_ instead of _contentFn_
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services