Skip to content

Commit

Permalink
test: check for correct click position in ImagePane
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hartmann authored and JackUrb committed Mar 20, 2023
1 parent cd0ce98 commit cb107e1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cypress/integration/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,21 @@ describe('Image Pane', () => {
.should('have.attr', 'ry', 30);
});

let click1 = [12, 34];
let click2 = [45, 67];
it('image_callback', () => {
cy.run('image_callback', { asyncrun: true });
cy.get(img_selector)
.parents(win_selector)
.click() // to focus the pane
.find('img')
.click(12, 34)
.click(45, 67);
.find('div.content')
.click(click1[0], click1[1])
.click(click2[0], click2[1]);
cy.get('.layout .react-grid-item .content-text')
.first()
.contains('Coords:')
.contains('x: 12, y: 35;') // bug: y is off by 1
.contains('x: 45, y: 68;'); // bug: y is off by 1
.contains(`x: ${click1[0]}, y: ${click1[1]};`)
.contains(`x: ${click2[0]}, y: ${click2[1]};`);
});

it('image_callback2', () => {
Expand Down

0 comments on commit cb107e1

Please sign in to comment.