initial commit
[namibia] / public / js / lib / syntaxhighlighter / tests / cases / 007_collapse.html
1 <pre id="sh_007_collapse_a" class="brush: groovy; collapse: true" title="This is a title for collapsed block">
2         /**
3          * Returns an Image object that can then be painted on the screen. 
4          * The url argument must specify an absolute {@link URL}. The name
5          * argument is a specifier that is relative to the url argument. 
6          *
7          * @param  url  an absolute URL giving the base location of the image
8          * @param  name the location of the image, relative to the url argument
9          * @return      the image at the specified URL
10          * @see         Image
11          */
12 </pre>
13
14 <pre id="sh_007_collapse_b" class="brush: groovy; collapse: true">
15         /**
16          * Returns an Image object that can then be painted on the screen. 
17          * The url argument must specify an absolute {@link URL}. The name
18          * argument is a specifier that is relative to the url argument. 
19          *
20          * @param  url  an absolute URL giving the base location of the image
21          * @param  name the location of the image, relative to the url argument
22          * @return      the image at the specified URL
23          * @see         Image
24          */
25 </pre>
26
27 <script type="text/javascript">
28 queue(function()
29 {
30         var $sh;
31         
32         module('007_collapse');
33         
34         test('collapsed block with title', function()
35         {
36                 $sh = $('#sh_007_collapse_a');
37                 
38                 ok_sh($sh);
39                 ok_toolbar($sh);
40                 ok_collapsed($sh);
41                 
42                 var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
43                 ok($title.length == 1, 'Expand present');
44                 equal($title.text(), 'This is a title for collapsed block', 'Expand text');
45         });
46
47         test('collapsed block without title', function()
48         {
49                 $sh = $('#sh_007_collapse_b');
50                 
51                 ok_sh($sh);
52                 ok_toolbar($sh);
53                 ok_collapsed($sh);
54                 
55                 var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
56                 ok($title.length == 1, 'Expand present');
57                 equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text');
58         });
59 });
60 </script>