Add some more logging to ModelView components (#13387)

* Add some more logging to ModelView components

* Remove catch

* remove unused
This commit is contained in:
Charles Gagnon
2020-11-13 10:30:40 -08:00
committed by GitHub
parent b3d99117ca
commit cbe2ba0901
35 changed files with 149 additions and 75 deletions

View File

@@ -9,13 +9,14 @@ import { ComponentBase, ContainerBase, ItemDescriptor } from 'sql/workbench/brow
import { ModelStore } from 'sql/workbench/browser/modelComponents/modelStore';
import { ChangeDetectorRef } from '@angular/core';
import { IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
import { NullLogService } from 'vs/platform/log/common/log';
class TestComponent extends ComponentBase<azdata.ComponentProperties> {
public descriptor: IComponentDescriptor;
constructor(public modelStore: IModelStore, id: string) {
super(undefined, undefined);
super(undefined, undefined, new NullLogService());
this.descriptor = modelStore.createComponentDescriptor('TestComponent', id);
this.baseInit();
}
@@ -32,7 +33,7 @@ class TestContainer extends ContainerBase<TestComponent> {
public descriptor: IComponentDescriptor;
constructor(public modelStore: IModelStore, id: string) {
super(undefined, undefined);
super(undefined, undefined, new NullLogService());
this.descriptor = modelStore.createComponentDescriptor('TestContainer', id);
this._changeRef = {
detectChanges: () => undefined

View File

@@ -6,6 +6,7 @@
import * as assert from 'assert';
import TableComponent from 'sql/workbench/browser/modelComponents/table.component';
import { CssIconCellValue } from 'sql/base/browser/ui/table/formatters';
import { NullLogService } from 'vs/platform/log/common/log';
suite('TableComponent Tests', () => {
@@ -19,7 +20,7 @@ suite('TableComponent Tests', () => {
['4', '5', '6']
];
let columns = ['c1', 'c2', 'c3'];
const tableComponent = new TableComponent(undefined, undefined, undefined);
const tableComponent = new TableComponent(undefined, undefined, undefined, new NullLogService());
let actual: { [key: string]: string | CssIconCellValue }[] = tableComponent.transformData(data, columns);
let expected: { [key: string]: string }[] = [
@@ -39,7 +40,7 @@ suite('TableComponent Tests', () => {
test('Table transformData should return empty array given undefined rows', () => {
let data = undefined;
const tableComponent = new TableComponent(undefined, undefined, undefined);
const tableComponent = new TableComponent(undefined, undefined, undefined, new NullLogService());
let columns = ['c1', 'c2', 'c3'];
let actual: { [key: string]: string | CssIconCellValue }[] = tableComponent.transformData(data, columns);
let expected: { [key: string]: string }[] = [];
@@ -52,7 +53,7 @@ suite('TableComponent Tests', () => {
['4', '5', '6']
];
let columns;
const tableComponent = new TableComponent(undefined, undefined, undefined);
const tableComponent = new TableComponent(undefined, undefined, undefined, new NullLogService());
let actual: { [key: string]: string | CssIconCellValue }[] = tableComponent.transformData(data, columns);
let expected: { [key: string]: string }[] = [];
assert.deepEqual(actual, expected);
@@ -63,7 +64,7 @@ suite('TableComponent Tests', () => {
['1', '2'],
['4', '5']
];
const tableComponent = new TableComponent(undefined, undefined, undefined);
const tableComponent = new TableComponent(undefined, undefined, undefined, new NullLogService());
let columns = ['c1', 'c2', 'c3'];
let actual: { [key: string]: string | CssIconCellValue }[] = tableComponent.transformData(data, columns);
let expected: { [key: string]: string }[] = [