Skip to content

Commit

Permalink
test(bem-cell): id field
Browse files Browse the repository at this point in the history
  • Loading branch information
qfox authored and blond committed Dec 11, 2016
1 parent 5707da8 commit 227ae94
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/fields.test.js
Expand Up @@ -28,3 +28,31 @@ test('should provide `layer` field', t => {

t.is(cell.layer, 'desktop');
});

test('should provide `id` field', t => {
const cell = new BemCell({
entity: new BemEntityName({ block: 'block' }),
layer: 'desktop',
tech: 'css'
});

t.is(cell.id, 'block@desktop.css');
});

test('should provide `id` field for cell with tech', t => {
const cell = new BemCell({
entity: new BemEntityName({ block: 'block' }),
tech: 'css'
});

t.is(cell.id, 'block.css');
});

test('should provide `id` field for cell with layer', t => {
const cell = new BemCell({
entity: new BemEntityName({ block: 'block' }),
layer: 'desktop',
});

t.is(cell.id, 'block@desktop');
});

0 comments on commit 227ae94

Please sign in to comment.