bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

Should support changing elemMods in runtime #111

Closed tadatuta closed 8 years ago

tadatuta commented 9 years ago

There is a test for changing mods in runtime (https://github.com/bem/bem-xjst/blob/master/test/runtime-test.js#L221) but same thing fails for elemMods. So this test

it('should support changing elemMods in runtime', function() {
      test(function() {
        block('b1').elem('e1').def()(function() {
          this.elemMods.a = 'b';
          return applyNext();
        });
      }, {
        block: 'b1',
        content: { elem: 'e1' }
      }, '<div class="b1"><div class="b1__e1 b1__e1_a_b"</div>');
    });

will fail with AssertionError: '<div class="b1"><div class="b1__e1"></div></div>' deepEqual '<div class="b1"><div class="b1__e1 b1__e1_a_b"</div>'.

qfox commented 8 years ago

Take a look pleasee?

/cc @indutny @veged

veged commented 8 years ago

looks ok