Show More
@@ -1,36 +1,36 | |||||
1 | // |
|
1 | // | |
2 | // Test that a Markdown cell is rendered to HTML. |
|
2 | // Test that a Markdown cell is rendered to HTML. | |
3 | // |
|
3 | // | |
4 | casper.notebook_test(function () { |
|
4 | casper.notebook_test(function () { | |
5 | // Test JavaScript models. |
|
5 | // Test JavaScript models. | |
6 | var output = this.evaluate(function () { |
|
6 | var output = this.evaluate(function () { | |
7 | IPython.notebook.to_markdown(); |
|
7 | IPython.notebook.to_markdown(); | |
8 | var cell = IPython.notebook.get_selected_cell(); |
|
8 | var cell = IPython.notebook.get_selected_cell(); | |
9 | cell.set_text('# Foo'); |
|
9 | cell.set_text('# Foo'); | |
10 | cell.render(); |
|
10 | cell.render(); | |
11 | return cell.get_rendered(); |
|
11 | return cell.get_rendered(); | |
12 | }); |
|
12 | }); | |
13 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.'); |
|
13 | this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.'); | |
14 |
|
14 | |||
15 | // Test menubar entries. |
|
15 | // Test menubar entries. | |
16 | output = this.evaluate(function () { |
|
16 | output = this.evaluate(function () { | |
17 | $('#to_code').mouseenter().click(); |
|
17 | $('#to_code').mouseenter().click(); | |
18 | $('#to_markdown').mouseenter().click(); |
|
18 | $('#to_markdown').mouseenter().click(); | |
19 | var cell = IPython.notebook.get_selected_cell(); |
|
19 | var cell = IPython.notebook.get_selected_cell(); | |
20 | cell.set_text('# Foo'); |
|
20 | cell.set_text('# Foo'); | |
21 | $('#run_cell').mouseenter().click(); |
|
21 | $('#run_cell').mouseenter().click(); | |
22 | return cell.get_rendered(); |
|
22 | return cell.get_rendered(); | |
23 | }); |
|
23 | }); | |
24 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.'); |
|
24 | this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.'); | |
25 |
|
25 | |||
26 | // Test toolbar buttons. |
|
26 | // Test toolbar buttons. | |
27 | output = this.evaluate(function () { |
|
27 | output = this.evaluate(function () { | |
28 | $('#cell_type').val('code').change(); |
|
28 | $('#cell_type').val('code').change(); | |
29 | $('#cell_type').val('markdown').change(); |
|
29 | $('#cell_type').val('markdown').change(); | |
30 | var cell = IPython.notebook.get_selected_cell(); |
|
30 | var cell = IPython.notebook.get_selected_cell(); | |
31 | cell.set_text('# Foo'); |
|
31 | cell.set_text('# Foo'); | |
32 | $('#run_b').click(); |
|
32 | $('#run_b').click(); | |
33 | return cell.get_rendered(); |
|
33 | return cell.get_rendered(); | |
34 | }); |
|
34 | }); | |
35 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.'); |
|
35 | this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.'); | |
36 | }); |
|
36 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now