mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Add some more logging to ModelView components (#13387)
* Add some more logging to ModelView components * Remove catch * remove unused
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }[] = [
|
||||
|
||||
Reference in New Issue
Block a user