corrade-http-templates – Blame information for rev 57
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
57 | office | 1 | define( [ |
2 | "qunit", |
||
3 | "jquery", |
||
4 | "ui/widgets/spinner" |
||
5 | ], function( QUnit, $ ) { |
||
6 | |||
7 | var originalSpinner = $.ui.spinner.prototype; |
||
8 | QUnit.module( "spinner: deprecated", { |
||
9 | beforeEach: function() { |
||
10 | $.widget( "ui.spinner", $.ui.spinner, { |
||
11 | _uiSpinnerHtml: function() { |
||
12 | return "<span class='spin-wrap'>"; |
||
13 | }, |
||
14 | |||
15 | _buttonHtml: function() { |
||
16 | return "" + |
||
17 | "<a class='spin-up'>" + |
||
18 | "<span>▲</span>" + |
||
19 | "</a>" + |
||
20 | "<a>" + |
||
21 | "<span>▼</span>" + |
||
22 | "</a>"; |
||
23 | } |
||
24 | } ); |
||
25 | }, |
||
26 | |||
27 | afterEach: function() { |
||
28 | $.ui.spinner.prototype = originalSpinner; |
||
29 | } |
||
30 | } ); |
||
31 | |||
32 | QUnit.test( "markup structure - custom", function( assert ) { |
||
33 | assert.expect( 2 ); |
||
34 | var element = $( "#spin" ).spinner(), |
||
35 | spinner = element.spinner( "widget" ), |
||
36 | up = spinner.find( ".ui-spinner-up" ); |
||
37 | |||
38 | assert.hasClasses( spinner, "ui-spinner ui-widget ui-widget-content spin-wrap", "_uiSpinnerHtml() overides default markup" ); |
||
39 | assert.hasClasses( up, "ui-spinner-button ui-spinner-up ui-widget spin-up", "_ButtonHtml() overides default markup" ); |
||
40 | } ); |
||
41 | |||
42 | } ); |