Properly expose errors in ads and tests (#8692)

* add code to expose errors outside zone

* remove unexpect error hiding

* remove uncessary code

* fix tests

* trying to catch more errros

* revert for testing

* wip

* wip

* figured out what was going on

* wip

* fix tests

* fix tests
This commit is contained in:
Anthony Dresser
2019-12-17 12:06:36 -08:00
committed by GitHub
parent 6b5c31410d
commit ea5f9be441
29 changed files with 483 additions and 790 deletions

View File

@@ -37,9 +37,7 @@ class TestChangeDetectorRef extends ChangeDetectorRef {
}
suite('Dashboard Properties Widget Tests', () => {
test('Parses good config', function (done) {
// for some reason mocha thinks this test takes 26 seconds even though it doesn't, so it says this failed because it took longer than 2 seconds
this.timeout(30000);
test('Parses good config', () => {
let propertiesConfig = {
properties: [
{
@@ -106,13 +104,15 @@ suite('Dashboard Properties Widget Tests', () => {
let testComponent = new PropertiesWidgetComponent(dashboardService.object, new TestChangeDetectorRef(), undefined, widgetConfig, testLogService);
// because config parsing is done async we need to put our asserts on the thread stack
setTimeout(() => {
// because properties is private we need to do some work arounds to access it.
assert.equal((<any>testComponent).properties.length, 1);
assert.equal((<any>testComponent).properties[0].displayName, 'Test');
assert.equal((<any>testComponent).properties[0].value, 'Test Property');
done();
return new Promise(resolve => {
// because config parsing is done async we need to put our asserts on the thread stack
setImmediate(() => {
// because properties is private we need to do some work arounds to access it.
assert.equal((<any>testComponent).properties.length, 1);
assert.equal((<any>testComponent).properties[0].displayName, 'Test');
assert.equal((<any>testComponent).properties[0].value, 'Test Property');
resolve();
});
});
});
});