Skip to content

Commit

Permalink
test: add test for z-index.
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto authored and andycall committed Aug 10, 2021
1 parent 208b1ae commit a4b5fc0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions integration_tests/specs/css/css-position/z-index.ts
Expand Up @@ -441,4 +441,34 @@ describe('z-index', () => {

await snapshot();
});

it('works with click', async (done) => {
const div = document.createElement('div');
div.style.position = 'relative';
div.style.width = '100px';
div.style.height = '100px';

const div2 = document.createElement('div');
div2.style.position = 'absolute';
div2.style.zIndex = '2';
div2.style.width = '100%';
div2.style.height = '100%';
div2.style.background = 'blue';
div2.addEventListener('click', ()=>{
done();
})

const div3 = document.createElement('div');
div3.style.position = 'absolute';
div3.style.zIndex = '1';
div3.style.width = '100%';
div3.style.height = '100%';
div3.style.background = 'red';

document.body.appendChild(div);
div.appendChild(div2);
div.appendChild(div3);

await simulateClick(10, 10);
})
});

0 comments on commit a4b5fc0

Please sign in to comment.