Brian E. Granger 6 anos atrás
pai
commit
0e04c6afd3
1 arquivos alterados com 18 adições e 0 exclusões
  1. 18 0
      tests/test-notebook/src/actions.spec.ts

+ 18 - 0
tests/test-notebook/src/actions.spec.ts

@@ -22,6 +22,10 @@ import {
   sleep,
   NBTestUtils
 } from '@jupyterlab/testutils';
+import {
+  JSONObject,
+  JSONArray
+} from '../../../node_modules/@phosphor/coreutils';
 
 const ERROR_INPUT = 'a = foo';
 
@@ -1012,6 +1016,20 @@ describe('@jupyterlab/notebook', () => {
         NotebookActions.copy(widget);
         expect(widget.mode).to.equal('command');
       });
+
+      it('should delete metadata.deletable', () => {
+        const next = widget.widgets[1];
+        widget.select(next);
+        next.model.metadata.set('deletable', false);
+        NotebookActions.copy(widget);
+        const data = NBTestUtils.clipboard.getData(
+          JUPYTER_CELL_MIME
+        ) as JSONArray;
+        data.map(cell => {
+          expect(((cell as JSONObject).metadata as JSONObject).deletable).to.be
+            .undefined;
+        });
+      });
     });
 
     describe('#cut()', () => {