1 | /*
|
---|
2 | * button_options.js
|
---|
3 | */
|
---|
4 | (function($) {
|
---|
5 |
|
---|
6 | module("button: options");
|
---|
7 |
|
---|
8 | test("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 |
|
---|
17 | test("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 |
|
---|
29 | test("label, default", function() {
|
---|
30 | $("#button").button();
|
---|
31 | same( $("#button").text(), "Label" );
|
---|
32 |
|
---|
33 | $("#button").button("destroy");
|
---|
34 | });
|
---|
35 |
|
---|
36 | test("label", function() {
|
---|
37 | $("#button").button({
|
---|
38 | label: "xxx"
|
---|
39 | });
|
---|
40 | same( $("#button").text(), "xxx" );
|
---|
41 |
|
---|
42 | $("#button").button("destroy");
|
---|
43 | });
|
---|
44 |
|
---|
45 | test("label default with input type submit", function() {
|
---|
46 | same( $("#submit").button().val(), "Label" );
|
---|
47 | });
|
---|
48 |
|
---|
49 | test("label with input type submit", function() {
|
---|
50 | var label = $("#submit").button({
|
---|
51 | label: "xxx"
|
---|
52 | }).val();
|
---|
53 | same( label, "xxx" );
|
---|
54 | });
|
---|
55 |
|
---|
56 | test("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);
|
---|