mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 08:37:23 +00:00
@@ -47,7 +47,7 @@ const webpackConfig = {
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules|vue-router\/|vue-loader\/|vue-hot-reload-api\/|docs|test|src\/index|packages\/swipe/,
|
||||
exclude: /node_modules|vue-router\/|vue-loader\/|vue-hot-reload-api\/|docs|test|src\/index|src\/utils|src\/mixins|packages\/swipe/,
|
||||
use: ['isparta-loader']
|
||||
},
|
||||
{
|
||||
|
@@ -1,31 +0,0 @@
|
||||
import { hasClass, addClass, removeClass } from 'src/utils/dom';
|
||||
|
||||
describe('Utils Dom', () => {
|
||||
let wrapper;
|
||||
beforeEach(() => {
|
||||
wrapper = document.createElement('div');
|
||||
wrapper.classList.add('test-class');
|
||||
document.body.appendChild(wrapper);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
document.body.removeChild(wrapper);
|
||||
});
|
||||
|
||||
it('hasClass', () => {
|
||||
expect(hasClass(wrapper, 'test-class')).to.be.true;
|
||||
expect(hasClass()).to.be.false;
|
||||
});
|
||||
|
||||
it('addClass and removeClass', () => {
|
||||
expect(hasClass(wrapper, 'test-class')).to.be.true;
|
||||
|
||||
addClass(wrapper, ' other-class');
|
||||
expect(hasClass(wrapper, 'other-class')).to.be.true;
|
||||
expect(addClass()).to.equal(undefined);
|
||||
|
||||
removeClass(wrapper, ' other-class');
|
||||
expect(hasClass(wrapper, 'other-class')).to.be.false;
|
||||
expect(removeClass()).to.equal(undefined);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user