Files
edx-platform/common/static/js/spec/CSS3_workarounds_spec.js
Syed Ali Abbas Zaidi f1fb38ed83 fix: multi lines and spaces issues (#31885)
* fix: multi lines and spaces issues

* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: remaining quotes issues

* fix: eslint object curly newline issue

* fix: eslint object curly spacing issue

* fix: eslint brace-style issues

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint linbreak style issue

* fix: eslint space unary operator issue

* fix: eslint line around directives issue

* fix: void and typeof space unary ops issue
2023-05-03 12:22:46 +05:00

34 lines
1.3 KiB
JavaScript

describe('CSS3 workarounds', function() {
'use strict';
var pointerEventsNone = window.pointerEventsNone;
describe('pointer-events', function() {
beforeEach(function() {
var html = "<a href='#' class='is-disabled'>What wondrous life in this I lead</a>";
setFixtures(html);
});
it('should not prevent default when pointerEvents is supported', function() {
// In case this test suite is being run in a browser where
// 'pointerEvents' is not supported, mock out document.body.style
// so that it includes 'pointerEvents'
var mockBodyStyle = document.body.style;
if (!('pointerEvents' in mockBodyStyle)) {
mockBodyStyle.pointerEvents = '';
}
pointerEventsNone('.is-disabled', mockBodyStyle);
spyOnEvent('.is-disabled', 'click');
$('.is-disabled').click();
expect('click').not.toHaveBeenPreventedOn('.is-disabled');
});
it('should prevent default when pointerEvents is not Supported', function() {
pointerEventsNone('.is-disabled', {});
spyOnEvent('.is-disabled', 'click');
$('.is-disabled').click();
expect('click').toHaveBeenPreventedOn('.is-disabled');
});
});
});