Skip to content

Commit

Permalink
fix observable.test.ts snapshots and browser driver mock
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 12, 2021
1 parent 4dd134e commit 92ce24c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": undefined,
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down Expand Up @@ -172,6 +173,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": undefined,
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down Expand Up @@ -223,6 +225,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": undefined,
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down Expand Up @@ -312,6 +315,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": [Error: An error occurred when trying to read the page for visualization panel info. You may need to increase 'xpack.reporting.capture.timeouts.waitForElements'. Error: Mock error!],
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down Expand Up @@ -354,6 +358,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": [Error: An error occurred when trying to read the page for visualization panel info. You may need to increase 'xpack.reporting.capture.timeouts.waitForElements'. Error: Mock error!],
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down Expand Up @@ -460,6 +465,7 @@ describe('Screenshot Observable Pipeline', () => {
},
],
"error": undefined,
"renderErrors": undefined,
"screenshots": Array [
Object {
"data": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ mockBrowserEvaluate.mockImplementation(() => {
if (mockCall === contexts.CONTEXT_ELEMENTATTRIBUTES) {
return Promise.resolve(getMockElementsPositionAndAttributes('Default Mock Title', 'Default '));
}
if (mockCall === contexts.CONTEXT_GETRENDERERRORS) {
return Promise.resolve();
}
throw new Error(mockCall);
});
const mockScreenshot = jest.fn(async () => Buffer.from('screenshot'));
Expand Down

0 comments on commit 92ce24c

Please sign in to comment.