You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('logs a message when the browser starts, but then crashes',async()=>{
173
+
registerDiagnoseBrowser(core,mockLogger);
174
+
175
+
awaitserver.start();
176
+
177
+
mockedCreateInterface.mockImplementation(()=>({
178
+
addEventListener: (e: string,cb: any)=>{
179
+
setTimeout(()=>cb(fontNotFoundMessage),0);
180
+
},
181
+
removeEventListener: jest.fn(),
182
+
removeAllListeners: jest.fn(),
183
+
close: jest.fn(),
184
+
}));
185
+
186
+
mockedSpawn.mockImplementation(()=>({
187
+
removeAllListeners: jest.fn(),
188
+
kill: jest.fn(),
189
+
addEventListener: (e: string,cb: any)=>{
190
+
if(e==='exit'){
191
+
setTimeout(()=>cb(),5);
192
+
}
193
+
},
194
+
removeEventListener: jest.fn(),
195
+
}));
196
+
197
+
returnsupertest(httpSetup.server.listener)
198
+
.post('/api/reporting/diagnose/browser')
199
+
.expect(200)
200
+
.then(({ body })=>{
201
+
expect(body).toMatchInlineSnapshot(`
202
+
Object {
203
+
"help": Array [
204
+
"The browser couldn't locate a default font. Please see https://www.elastic.co/guide/en/kibana/current/reporting-troubleshooting.html#reporting-troubleshooting-system-dependencies to fix this issue.",
0 commit comments