Fixed #4113 Added integration tests to cover cell language unit tests (#5788)

* Fixed #4113

* Resolve PR comments
This commit is contained in:
Yurong He
2019-05-31 15:03:21 -07:00
committed by GitHub
parent 1bb9d142f1
commit 9f4053d051
3 changed files with 126 additions and 61 deletions

View File

@@ -88,25 +88,6 @@ suite('Cell Model', function (): void {
should(cell.language).equal('python');
});
// Failing test disabled - see https://github.com/Microsoft/azuredatastudio/issues/4113
/*
test('Should set cell language to scala if defined as scala in languageInfo', async function (): Promise<void> {
let cellData: nb.ICellContents = {
cell_type: CellTypes.Code,
source: 'print(\'1\')',
metadata: {},
execution_count: 1
};
let notebookModel = new NotebookModelStub({
name: 'scala',
version: '',
mimetype: ''
});
let cell = factory.createCell(cellData, { notebook: notebookModel, isTrusted: false });
should(cell.language).equal('scala');
});
*/
test('Should keep cell language as python if cell has language override', async function (): Promise<void> {
let cellData: nb.ICellContents = {
cell_type: CellTypes.Code,
@@ -141,46 +122,6 @@ suite('Cell Model', function (): void {
should(cell.language).equal('python');
});
// Failing test disabled - see https://github.com/Microsoft/azuredatastudio/issues/4113
/*
test('Should match cell language to language specified if unknown language defined in languageInfo', async function (): Promise<void> {
let cellData: nb.ICellContents = {
cell_type: CellTypes.Code,
source: 'std::cout << "hello world";',
metadata: {},
execution_count: 1
};
let notebookModel = new NotebookModelStub({
name: 'cplusplus',
version: '',
mimetype: ''
});
let cell = factory.createCell(cellData, { notebook: notebookModel, isTrusted: false });
should(cell.language).equal('cplusplus');
});
*/
// Failing test disabled - see https://github.com/Microsoft/azuredatastudio/issues/4113
/*
test('Should match cell language to mimetype name is not supplied in languageInfo', async function (): Promise<void> {
let cellData: nb.ICellContents = {
cell_type: CellTypes.Code,
source: 'print(\'1\')',
metadata: {},
execution_count: 1
};
let notebookModel = new NotebookModelStub({
name: '',
version: '',
mimetype: 'x-scala'
});
let cell = factory.createCell(cellData, { notebook: notebookModel, isTrusted: false });
should(cell.language).equal('scala');
});
*/
suite('Model Future handling', function (): void {
let future: TypeMoq.Mock<EmptyFuture>;
let cell: ICellModel;