UNPKG

1.43 kBJavaScriptView Raw
1'use strict';
2
3var assert = require('chai').assert,
4 buildBemdeclByBemjson = require('..').require('./techs/v2/bemdecl.js.js').techMixin.buildBemdeclByBemjson;
5
6/**
7 * Mocha BDD interface.
8 */
9/** @name describe @function */
10/** @name it @function */
11/** @name before @function */
12/** @name after @function */
13/** @name beforeEach @function */
14/** @name afterEach @function */
15
16describe('BEMDECL', function() {
17 describe('buildBemdeclByBemjson:', function() {
18 it('should properly parse custom content fields', function() {
19 assert.deepEqual(
20 buildBemdeclByBemjson({
21 block: 'b',
22 bem: { block: 'bla4' },
23 tag: { block: 'bla5' },
24 attrs: { block: 'bla6' },
25 cls: { block: 'bla7' },
26 js: { block: 'bla8' },
27 custom1: { block: 'b1' },
28 custom2: {
29 a1: { block: 'a1' },
30 a2: { block: 'a2' }
31 },
32 mix: [ { block: 'c' } ],
33 content: { block: 'd' }
34 }),
35 [
36 { name: 'b' },
37 { name: 'b1' },
38 { name: 'a1' },
39 { name: 'a2' },
40 { name: 'c' },
41 { name: 'd' }
42 ]
43 );
44 });
45 });
46});