Skip to content

Commit

Permalink
test stubbing window.open
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Tackett <[email protected]>
  • Loading branch information
Adam Tackett committed Oct 28, 2024
1 parent 970f481 commit 395d5b5
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,17 @@ describe('Test reporting integration if the plugin is installed', () => {
});
});

it.skip('Create in-context PDF report from notebook', () => {
it('Create in-context PDF report from notebook', () => {
cy.get('#reportingActionsButton').click();
cy.get('button.euiContextMenuItem:nth-child(1)')
.contains('Download PDF')
.click();

//Stub window.open to prevent new tab
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});

cy.get('body').contains('Please continue report generation in the new tab');
});

Expand All @@ -135,6 +141,12 @@ describe('Test reporting integration if the plugin is installed', () => {
cy.get('button.euiContextMenuItem:nth-child(2)')
.contains('Download PNG')
.click();

//Stub window.open to prevent new tab
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});

cy.get('body').contains('Please continue report generation in the new tab');
});

Expand Down

0 comments on commit 395d5b5

Please sign in to comment.