File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,27 @@ describe('paste-markdown', function () {
3838 assert . include ( textarea . value , 'name | origin\n-- | --\nhubot | github\nbender | futurama' )
3939 } )
4040
41+ it ( 'rejects tables with extra text' , async function ( ) {
42+ const data = {
43+ 'text/html' : `
44+ <p>Here is a cool table</p>
45+ <table>
46+ <thead><tr><th>name</th><th>origin</th></tr></thead>
47+ <tbody>
48+ <tr><td>hubot</td><td>github</td></tr>
49+ <tr><td>bender</td><td>futurama</td></tr>
50+ </tbody>
51+ </table>
52+ <p>Very cool</p>
53+ `
54+ }
55+
56+ // Synthetic paste events don't manipulate the DOM. A empty textarea
57+ // means that the event handler didn't fire and normal paste happened.
58+ paste ( textarea , data )
59+ assert . equal ( textarea . value , '' )
60+ } )
61+
4162 it ( 'rejects layout tables' , function ( ) {
4263 const data = {
4364 'text/html' : `
@@ -51,6 +72,9 @@ describe('paste-markdown', function () {
5172 `
5273 }
5374 paste ( textarea , data )
75+
76+ // Synthetic paste events don't manipulate the DOM. A empty textarea
77+ // means that the event handler didn't fire and normal paste happened.
5478 assert . equal ( textarea . value , '' )
5579 } )
5680
You can’t perform that action at this time.
0 commit comments