Skip to content

Commit a191a81

Browse files
committed
checking if the a tag exists
1 parent 4368655 commit a191a81

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cypress/integration/spectral-workbench-demo.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@ context('Actions', () => {
2828
cy.get('.bs-stepper-header>div').eq(6).not('have.class', 'active')
2929
});
3030

31-
31+
it('The download button should download the current spectrum image', () => {
32+
cy.get('.bs-stepper-header>div').eq(4).contains('Capture').click()
33+
cy.get('#temp-anchor-tag').should('not.exist')
34+
cy.get('#download-spectrum').click()
35+
cy.get('#temp-anchor-tag').should('exist')
36+
cy.get('#temp-anchor-tag').should('not.exist')
37+
});
3238
})

examples/capture/capture.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ $W = {
166166
console.log(base64_imgdata);
167167

168168
let a = document.createElement('a');
169+
a.setAttribute("id", "temp-anchor-tag");
169170
a.href = base64_imgdata;
170171
a.download = ('spectrum_img.png');
171172
a.click();

0 commit comments

Comments
 (0)