update <title>
[mkws-moved-to-github.git] / test / spec / jquery.spec.js
1 /* Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com
2  *
3  * jquery test
4  *
5  */
6
7 describe("jquery suite simple", function () {
8     var $ = require('jquery')(require("jsdom").jsdom().parentWindow);
9
10     it("jquery append test", function () {
11         $("body").append("<h1>test passes h1</h1>");
12         expect($("body").html()).toMatch(/<h1>/);
13         $("<p>this is a paragraph</p>").appendTo("h1");
14         expect($("body").html()).toMatch(/this is a paragraph/);
15     });
16
17     it("$ append test", function () {
18         $("<h2>test passes h2</h2>").appendTo("body");
19         expect($("body").html()).toMatch(/<h2>/);
20
21         $("<p>this is a second paragraph</p>").appendTo("h1");
22         expect($("body").html()).toMatch(/this is a paragraph/);
23     });
24
25     it("more jquery tests", function () {
26         // other tests
27         expect($("h2").html()).toMatch(/test passes h2/);
28         expect($("h1").html()).toMatch(/test passes h1/);
29         expect($("h1").html()).not.toMatch(/^$/);
30         expect($("h1").html()).not.toMatch(/foobar/);
31     });
32 });