This commit is contained in:
Oleg Mokhov
2015-06-20 12:26:08 +03:00
committed by mokhov
parent a716969f4e
commit f3546ef3a5
85 changed files with 16682 additions and 1 deletions

View File

@@ -0,0 +1,63 @@
modules.define(
'test',
[
'y-block-event'
],
function (
provide,
YBlockEvent
) {
describe('YBlockEvent', function () {
describe('new YBlockEvent("type")', function () {
var event;
beforeEach(function () {
event = new YBlockEvent('foo');
});
it('should not stop propagation and not stop default action', function () {
event.isPropagationStopped().should.be.false;
event.isDefaultPrevented().should.be.false;
});
it('should have property `type`', function () {
event.type.should.eq('foo');
});
});
describe('new YBlockEvent("type", true, false)', function () {
it('should stop propagation', function () {
var event = new YBlockEvent('type', true, false);
event.isPropagationStopped().should.be.true;
event.isDefaultPrevented().should.be.false;
});
});
describe('new YBlockEvent("type", false, true)', function () {
it('should prevent default action', function () {
var event = new YBlockEvent('type', false, true);
event.isPropagationStopped().should.be.false;
event.isDefaultPrevented().should.be.true;
});
});
describe('preventDefault()', function () {
it('should prevent default action of event', function () {
var event = new YBlockEvent('type');
event.preventDefault();
event.isDefaultPrevented().should.be.true;
});
});
describe('stopPropagation()', function () {
it('should stop propagation of event', function () {
var event = new YBlockEvent('type');
event.stopPropagation();
event.isPropagationStopped().should.be.true;
});
});
});
provide();
});