##// END OF EJS Templates
don't store signatures in notebooks...
don't store signatures in notebooks store them in an sqlite database instead. The algorithm and signature are stored and not associated with a path. This means that moving files around doesn't affect trust, and every trusted change to a notebook remains trusted.

File last commit:

r18596:2d590459
r19625:0dbcfac8
Show More
dualmode_cellmode.js
40 lines | 2.4 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Cleaned up test names and locations.
r15936 // Test keyboard shortcuts that change the cell's mode.
// Test
casper.notebook_test(function () {
this.then(function () {
// Cell mode change
MinRK
remove heading cells in v4
r18596 var index = 0;
this.select_cell(index);
var a = 'hello\nmulti\nline';
this.set_cell_text(index, a);
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('esc','r');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'raw', 'r; cell is raw');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('1');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '1; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '# ' + a, '1; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('2');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '2; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '## ' + a, '2; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('3');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '3; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '### ' + a, '3; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('4');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '4; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '#### ' + a, '4; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('5');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '5; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '##### ' + a, '5; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('6');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '6; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '###### ' + a, '6; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('m');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', 'm; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '###### ' + a, 'm; still markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('y');
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(index).cell_type, 'code', 'y; cell is code');
this.test.assertEquals(this.get_cell_text(index), '###### ' + a, 'y; still has hashes');
this.trigger_keydown('1');
this.test.assertEquals(this.get_cell(index).cell_type, 'markdown', '1; cell is markdown');
this.test.assertEquals(this.get_cell_text(index), '# ' + a, '1; markdown heading');
Jonathan Frederic
Cleaned up test names and locations.
r15936 });
});