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

Test "changes classes in selector" identical to "changes the elements classes" #632

Open
mightyiam opened this issue May 15, 2020 · 0 comments

Comments

@mightyiam
Copy link
Contributor

snabbdom/src/test/core.ts

Lines 232 to 249 in a42c31a

it('changes the elements classes', function () {
var vnode1 = h('i', { class: { i: true, am: true, horse: true } });
var vnode2 = h('i', { class: { i: true, am: true, horse: false } });
patch(vnode0, vnode1);
elm = patch(vnode1, vnode2).elm;
assert(elm.classList.contains('i'));
assert(elm.classList.contains('am'));
assert(!elm.classList.contains('horse'));
});
it('changes classes in selector', function () {
var vnode1 = h('i', { class: { i: true, am: true, horse: true } });
var vnode2 = h('i', { class: { i: true, am: true, horse: false } });
patch(vnode0, vnode1);
elm = patch(vnode1, vnode2).elm;
assert(elm.classList.contains('i'));
assert(elm.classList.contains('am'));
assert(!elm.classList.contains('horse'));
});

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

1 participant