source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/tests/unit/resizable/resizable_methods.js@ 24245

Last change on this file since 24245 was 24245, checked in by sjb48, 13 years ago

Oran code for supporting format changes to document.

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/*
2 * resizable_methods.js
3 */
4(function($) {
5
6module("resizable: methods");
7
8test("init", function() {
9 expect(6);
10
11 $("<div></div>").appendTo('body').resizable().remove();
12 ok(true, '.resizable() called on element');
13
14 $([]).resizable().remove();
15 ok(true, '.resizable() called on empty collection');
16
17 $('<div></div>').resizable().remove();
18 ok(true, '.resizable() called on disconnected DOMElement');
19
20 $('<div></div>').resizable().resizable("foo").remove();
21 ok(true, 'arbitrary method called after init');
22
23 el = $('<div></div>').resizable()
24 var foo = el.resizable("option", "foo");
25 el.remove();
26 ok(true, 'arbitrary option getter after init');
27
28 $('<div></div>').resizable().resizable("option", "foo", "bar").remove();
29 ok(true, 'arbitrary option setter after init');
30});
31
32test("destroy", function() {
33 $("<div></div>").appendTo('body').resizable().resizable("destroy").remove();
34 ok(true, '.resizable("destroy") called on element');
35
36 $([]).resizable().resizable("destroy").remove();
37 ok(true, '.resizable("destroy") called on empty collection');
38
39 $('<div></div>').resizable().resizable("destroy").remove();
40 ok(true, '.resizable("destroy") called on disconnected DOMElement');
41
42 $('<div></div>').resizable().resizable("destroy").resizable("foo").remove();
43 ok(true, 'arbitrary method called after destroy');
44
45 var expected = $('<div></div>').resizable(),
46 actual = expected.resizable('destroy');
47 equals(actual, expected, 'destroy is chainable');
48});
49
50test("enable", function() {
51 var expected = $('<div></div>').resizable(),
52 actual = expected.resizable('enable');
53 equals(actual, expected, 'enable is chainable');
54 ok(false, "missing test - untested code is broken code.");
55});
56
57test("disable", function() {
58 var expected = $('<div></div>').resizable(),
59 actual = expected.resizable('disable');
60 equals(actual, expected, 'disable is chainable');
61 ok(false, "missing test - untested code is broken code.");
62});
63
64})(jQuery);
Note: See TracBrowser for help on using the repository browser.