source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/tests/unit/button/button_options.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: 1.4 KB
Line 
1/*
2 * button_options.js
3 */
4(function($) {
5
6module("button: options");
7
8test("text false without icon", function() {
9 $("#button").button({
10 text: false
11 });
12 ok( $("#button").is(".ui-button-text-only:not(.ui-button-icon-only)") );
13
14 $("#button").button("destroy");
15});
16
17test("text false with icon", function() {
18 $("#button").button({
19 text: false,
20 icons: {
21 primary: "iconclass"
22 }
23 });
24 ok( $("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)") );
25
26 $("#button").button("destroy");
27});
28
29test("label, default", function() {
30 $("#button").button();
31 same( $("#button").text(), "Label" );
32
33 $("#button").button("destroy");
34});
35
36test("label", function() {
37 $("#button").button({
38 label: "xxx"
39 });
40 same( $("#button").text(), "xxx" );
41
42 $("#button").button("destroy");
43});
44
45test("label default with input type submit", function() {
46 same( $("#submit").button().val(), "Label" );
47});
48
49test("label with input type submit", function() {
50 var label = $("#submit").button({
51 label: "xxx"
52 }).val();
53 same( label, "xxx" );
54});
55
56test("icons", function() {
57 $("#button").button({
58 text: false,
59 icons: {
60 primary: "iconclass",
61 secondary: "iconclass2"
62 }
63 });
64 ok( $("#button").is(":has(span.ui-icon.ui-button-icon-primary.iconclass):has(span.ui-icon.ui-button-icon-secondary.iconclass2)") );
65
66 $("#button").button("destroy");
67});
68
69})(jQuery);
Note: See TracBrowser for help on using the repository browser.