|
6 | 6 |
|
7 | 7 | import * as assert from 'assert';
|
8 | 8 | import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
|
9 |
| -import { MarkdownString, NotebookCellOutputItem } from 'vs/workbench/api/common/extHostTypeConverters'; |
| 9 | +import { MarkdownString, NotebookCellOutputItem, NotebookData } from 'vs/workbench/api/common/extHostTypeConverters'; |
10 | 10 | import { isEmptyObject } from 'vs/base/common/types';
|
11 | 11 | import { forEach } from 'vs/base/common/collections';
|
12 | 12 | import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
|
@@ -83,6 +83,20 @@ suite('ExtHostTypeConverter', function () {
|
83 | 83 | });
|
84 | 84 | });
|
85 | 85 |
|
| 86 | + test('Notebook metadata is ignored when using Notebook Serializer #125716', function () { |
| 87 | + |
| 88 | + const d = new extHostTypes.NotebookData([]); |
| 89 | + d.cells.push(new extHostTypes.NotebookCellData(extHostTypes.NotebookCellKind.Code, 'hello', 'fooLang')); |
| 90 | + d.metadata = { custom: { foo: 'bar', bar: 123 } }; |
| 91 | + |
| 92 | + const dto = NotebookData.from(d); |
| 93 | + |
| 94 | + assert.strictEqual(dto.cells.length, 1); |
| 95 | + assert.strictEqual(dto.cells[0].language, 'fooLang'); |
| 96 | + assert.strictEqual(dto.cells[0].source, 'hello'); |
| 97 | + assert.deepStrictEqual(dto.metadata, d.metadata); |
| 98 | + }); |
| 99 | + |
86 | 100 | test('NotebookCellOutputItem', function () {
|
87 | 101 |
|
88 | 102 | const item = extHostTypes.NotebookCellOutputItem.text('Hello', 'foo/bar');
|
|
0 commit comments