Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const test = require('ava'); | ||
|
||
const BemEntityName = require('@bem/entity-name'); | ||
|
||
const BemCell = require('../index'); | ||
|
||
const cell = new BemCell({ entity: new BemEntityName({ block: 'b', elem: 'e', mod: { name: 'm', val: 'v' } }) }); | ||
const modLessCell = new BemCell({ entity: new BemEntityName({ block: 'b' }) }); | ||
|
||
test('should return block field from entity', t => { | ||
t.is(cell.block, cell.entity.block); | ||
}); | ||
|
||
test('should return elem field from entity', t => { | ||
t.is(cell.elem, cell.entity.elem); | ||
}); | ||
|
||
test('should return modName field from entity', t => { | ||
t.is(cell.modName, cell.entity.modName); | ||
}); | ||
|
||
test('should return modVal field from entity', t => { | ||
t.is(cell.modVal, cell.entity.modVal); | ||
}); | ||
|
||
test('should return mod field from entity', t => { | ||
t.deepEqual(cell.mod, cell.entity.mod); | ||
}); | ||
|
||
test('should return undefined for modName field from entity', t => { | ||
t.is(modLessCell.modName, undefined); | ||
}); | ||
|
||
test('should return undefined for modVal field from entity', t => { | ||
t.is(modLessCell.modVal, undefined); | ||
}); | ||
|
||
test('should return undefined for mod field from entity', t => { | ||
t.is(modLessCell.mod, undefined); | ||
}); |