Skip to content

Commit

Permalink
Merge pull request #253 from bem/fix#251@v2
Browse files Browse the repository at this point in the history
Fixes for library tests
  • Loading branch information
Vladimir Varankin committed Dec 26, 2013
2 parents 8683caa + 010e83a commit 5fa8ac2
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 21 deletions.
26 changes: 16 additions & 10 deletions .bem/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
var PATH = require('path'),
environ = require('bem-environ')(__dirname);

environ.extendMake(MAKE);
require('bem-tools-autoprefixer').extendMake(MAKE);

require('./nodes')(MAKE);

try {
Expand Down Expand Up @@ -181,10 +179,9 @@ MAKE.decl('TargetBundleNode', {
environ.getLibPath('bem-core', 'common.blocks'),
environ.getLibPath('bem-core', 'touch.blocks'),
'common.blocks',
'design/common.blocks',
'touch.blocks',
'design/common.blocks',
'design/touch.blocks',
'touch-pad.blocks',
'design/touch-pad.blocks'
];
},
Expand All @@ -194,8 +191,8 @@ MAKE.decl('TargetBundleNode', {
environ.getLibPath('bem-core', 'common.blocks'),
environ.getLibPath('bem-core', 'touch.blocks'),
'common.blocks',
'design/common.blocks',
'touch.blocks',
'design/common.blocks',
'design/touch.blocks',
'design/touch-phone.blocks'
];
Expand Down Expand Up @@ -240,11 +237,20 @@ MAKE.decl('ExampleNode', {
MAKE.decl('SpecNode', {

getTechs : function() {
return this.__base()
.concat([
'spec.js+browser.js+bemhtml',
'phantomjs'
]);
return [
'bemjson.js',
'bemdecl.js',
'deps.js',
'roole',
'spec.js+browser.js+bemhtml',
'bemhtml',
'html',
'phantomjs'
];
},

getForkedTechs : function() {
return ['bemhtml', 'spec.js+browser.js+bemhtml', 'phantomjs'];
},

getLevels : function() {
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/input/_type/input_type_password.bemhtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
block('input').mod('type', 'password').elem('control').attrs()(function() {
return this._.extend(applyNext(), { type: 'password' })
return this.extend(applyNext(), { type: 'password' })
})
2 changes: 1 addition & 1 deletion common.blocks/input/_type/input_type_search.bemhtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
block('input').mod('type', 'search').elem('control').attrs()(function() {
return this._.extend(applyNext(), { type: 'search' })
return this.extend(applyNext(), { type: 'search' })
})
2 changes: 1 addition & 1 deletion common.blocks/input/_type/input_type_textarea.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ block('input').mod('type', 'textarea').elem('control')(
var attrs = applyNext(),
input = this._input;
delete attrs.value;
return this._.extend(
return this.extend(
{ rows: input.rows || 10, cols: input.cols || 10 },
attrs);
}),
Expand Down
4 changes: 3 additions & 1 deletion common.blocks/link/link.deps.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[{
mustDeps : { block : 'i-bem', elem : 'dom' },
mustDeps : [
{ block : 'i-bem', elems : ['dom'] }
],
shouldDeps : [
{ mod : 'disabled' },
{ block : 'jquery', elem : 'event', mods : { type : 'pointer' } }
Expand Down
6 changes: 3 additions & 3 deletions common.blocks/link/link.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
modules.define(
'spec',
['i-bem__dom', 'jquery', 'BEMHTML', 'sinon'],
function(provide, DOM, $, BEMHTML, sinon) {
function(provide, BEMDOM, $, BEMHTML, sinon) {

describe('link', function() {
var link;

beforeEach(function() {
link = DOM.init(
link = BEMDOM.init(
$(BEMHTML.apply({
block : 'link',
js : true
Expand All @@ -17,7 +17,7 @@ describe('link', function() {
});

afterEach(function() {
DOM.destruct(link.domElem);
BEMDOM.destruct(link.domElem);
});

it('should emit "click" event and do not prevent default action', function() {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"optionalDependencies": {},
"private": true,
"scripts": {
"test": "jshint-groups && jscs . && csscomb -vl ."
"test": "npm run lint && npm run unit",
"lint": "jshint-groups && jscs . && csscomb -vl .",
"unit": "bower-npm-install && bem make -w 16 desktop.specs touch-pad.specs touch-phone.specs"
}
}

6 changes: 3 additions & 3 deletions touch.blocks/input/__control/input__control.bemhtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
block('input').elem('control')(

attrs()(function() {
var baseAttrs = applyNext(),
attrs().match(function() { return !this.ctx._input__controlAttrs })(function() {
var baseAttrs = applyNext({ 'ctx._input__controlAttrs': true }),
attrs = this.ctx.attrs || {};

attrs.autocomplete = attrs.autocomplete || 'off';
attrs.autocorrect = attrs.autocorrect || 'off';
attrs.autocapitalize = attrs.autocapitalize || 'off';
attrs.spellcheck = attrs.spellcheck || 'false';

return this._.extend(baseAttrs, attrs);
return this.extend(baseAttrs, attrs);
})

)

0 comments on commit 5fa8ac2

Please sign in to comment.