Ensure that the google charts library is loaded before calling it. (#3034)
This commit is contained in:
Родитель
7c1bf8d2f3
Коммит
ae58989d1e
|
@ -12,7 +12,10 @@ describe('chromedash-timeline-page', () => {
|
|||
await fixture(html`<chromedash-toast></chromedash-toast>`);
|
||||
sinon.stub(window, 'fetch');
|
||||
// hacky way to stub out google chart load method
|
||||
window.google = {charts: {load: () => {}}};
|
||||
window.google = {charts: {
|
||||
load: () => {},
|
||||
setOnLoadCallback: (f) => f(),
|
||||
}};
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
|
@ -100,7 +100,7 @@ class ChromedashTimeline extends LitElement {
|
|||
}
|
||||
|
||||
updated() {
|
||||
this._updateTimeline();
|
||||
window.google.charts.setOnLoadCallback(this._updateTimeline.bind(this));
|
||||
}
|
||||
|
||||
updateSelectedBucketId(e) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче