source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/tests/unit/core/core.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.5 KB
Line 
1/*
2 * core unit tests
3 */
4(function($) {
5
6module('core - jQuery extensions');
7
8test("attr - aria", function() {
9 expect(6);
10
11 var el = $('#aria');
12
13 ok(!el.attr('role'), 'role is empty via attr');
14 equals(el.attr('role', 'tablist').attr('role'), 'tablist', 'role is tablist');
15
16 equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined');
17
18 el.attr('aria-expanded', true);
19 equals(el.attr('aria-expanded'), 'true', 'aria expanded is true');
20
21 el.removeAttr('aria-expanded');
22 equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined after removing');
23
24 el.attr('aria-expanded', false);
25 equals(el.attr('aria-expanded'), 'false', 'aria expanded is false');
26});
27
28test('focus', function() {
29 expect(3);
30
31 var el = $('#inputTabindex0'),
32 // used to remove focus from the main element
33 other = $('#inputTabindex10');
34
35 // test original functionality
36 el.focus(function() {
37 ok(true, 'event triggered');
38 });
39 el.focus();
40 other.focus();
41
42 // trigger event handler + callback
43 stop();
44 el.focus(500, function() {
45 start();
46 ok(true, 'callback triggered');
47 });
48 other.focus();
49});
50
51test('zIndex', function() {
52 var el = $('#zIndexAutoWithParent');
53 equals(el.zIndex(), 100, 'zIndex traverses up to find value');
54 equals(el.zIndex(200), el, 'zIndex setter is chainable');
55 equals(el.zIndex(), 200, 'zIndex setter changed zIndex');
56
57 equals($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy');
58});
59
60})(jQuery);
Note: See TracBrowser for help on using the repository browser.