Bug Tracker

Ticket #2280: align.html

File align.html, 1.8 KB (added by choan, 12 years ago)

Tests (to be put inside the "test/" folder)

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
8  <title>Test align</title>
9 
10  <link rel="Stylesheet" media="screen" href="data/testsuite.css"/>
11  <script type="text/javascript" src="../dist/jquery.js"></script>
12  <script type="text/javascript" src="data/testrunner.js"></script>
13  <script>
14  test("Selection by align attribute", function() {
15    expect(11);
16        ok($('table[align]').length == 2, "table[align]" );
17        ok($('table[align=left]').length == 0, "table[align=left]");
18        ok($('th[align]').length == 1, "th[align]");
19        ok($('th[align=left]').length == 1, "th[align=left]");
20        ok($('tr[align=left]').length == 1, "tr[align=left]");
21        ok($('table[align=center]').length == 1, "table[align=center]");
22        ok($('#aligned [align]').length == 1, "#aligned [align]");
23        ok($('#aligned [align=center]').length == 1, "#aligned [align=center]");
24        ok($('#aligned [align=left]').length == 0, "#aligned [align=left]");
25        ok($('#not-aligned [align]').length == 0, "#not-aligned [align]");
26        ok($('#multi-align [align]').length == 3, "#multi-align [align]");
27  });
28  </script>
29 
30 
31</head>
32
33<body>
34        <h1 id="header">jQuery - Test selection by align attribute</h1>
35        <h2 id="banner"></h2>
36        <h2 id="userAgent"></h2>
37
38
39<div id="main">
40
41<div id="aligned">
42<table align="center"><tbody>
43  <tr><th>Header</th></tr>
44  <tr><td>Data</td></tr>
45</tbody></table>
46</div>
47
48<div id="not-aligned">
49<table>
50<tbody>  <tr><th>Header</th></tr>
51  <tr><td>Data</td></tr>
52</tbody></table>
53</div>
54
55<div id="multi-align">
56<table align="right">
57<tbody>  <tr><th align="left">Header</th></tr>
58  <tr align="left"><td>Data</td></tr>
59</tbody></table>
60</div>
61
62</div>
63
64<ol id="tests"></ol>
65
66
67</body>
68</html>