Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_elems() with mods doesn't work #1597

Open
belozer opened this issue Aug 20, 2018 · 0 comments
Open

_elems() with mods doesn't work #1597

belozer opened this issue Aug 20, 2018 · 0 comments

Comments

@belozer
Copy link
Member

belozer commented Aug 20, 2018

Test case

it('should use difference caches for elem mods', function() {
    var Block = bemDom.declBlock('block');
    rootNode = createDomNode({
        block : 'block',
        content : [
            { elem : 'elem', elemMods : { m1 : true } },
            { elem : 'elem', elemMods : { m2 : true } },
            { elem : 'elem', elemMods : { m2 : true } },
            { elem : 'elem' },
        ]
    });

    block = rootNode.bem(Block);

    // Expected: 1, Actual: 1
    block._elems({ elem : 'elem', modName : 'm1' }).size().should.be.equal(1);

    // Expected: 2, Actual: 1
    block._elems({ elem : 'elem', modName : 'm2' }).size().should.be.equal(2);

    // Expected: 4, Actual: 1
    block._elems('elem').size().should.be.equal(4);
});

CodePen https://codepen.io/belozer/pen/eLYVPK?editors=0012

@belozer belozer changed the title Bug with cached _elems and setMod (v4) Bug: cached _elems with mods (v4) Aug 21, 2018
@veged veged changed the title Bug: cached _elems with mods (v4) _elems() with mods doesn't work Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants