Fix more floating promises (#8460)

This commit is contained in:
Charles Gagnon
2019-11-27 08:04:51 -08:00
committed by GitHub
parent 4145ecfb32
commit 0e9797c394
14 changed files with 84 additions and 90 deletions

View File

@@ -29,7 +29,7 @@ const testColumns: string[] = [
];
suite('Insights Dialog Controller Tests', () => {
test('updates correctly with good input', done => {
test('updates correctly with good input', async (done) => {
let model = new InsightsDialogModel();
@@ -71,20 +71,19 @@ suite('Insights Dialog Controller Tests', () => {
options: {}
};
controller.update(<IInsightsConfigDetails>{ query: 'query' }, profile).then(() => {
// Once we update the controller, listen on when it changes the model and verify the data it
// puts in is correct
model.onDataChange(() => {
for (let i = 0; i < testData.length; i++) {
for (let j = 0; j < testData[i].length; j++) {
equal(testData[i][j], model.rows[i][j]);
}
await controller.update(<IInsightsConfigDetails>{ query: 'query' }, profile);
// Once we update the controller, listen on when it changes the model and verify the data it
// puts in is correct
model.onDataChange(() => {
for (let i = 0; i < testData.length; i++) {
for (let j = 0; j < testData[i].length; j++) {
equal(testData[i][j], model.rows[i][j]);
}
done();
});
// Fake the query Runner telling the controller the query is complete
complete();
}
done();
});
// Fake the query Runner telling the controller the query is complete
complete();
});
});