Archived
oh please work
This commit is contained in:
1 parent
e3c2d1b295
commit
18467e0fd4
142 files changed
+22252
No files matched your search
@@ -0,0 +1,17 @@
|
||||
'use babel';
|
||||
|
||||
import toCamelCase from '../../lib/helper/to-camel-case';
|
||||
|
||||
describe('camelCaseHelper', () => {
|
||||
it('should convert spaces to camelCase', () => {
|
||||
expect(toCamelCase('hello world')).toEqual('helloWorld');
|
||||
});
|
||||
|
||||
it('should convert lisp-case to camelCase', () => {
|
||||
expect(toCamelCase('hello-world')).toEqual('helloWorld');
|
||||
});
|
||||
|
||||
it('should convert snake_case to camelCase', () => {
|
||||
expect(toCamelCase('hello_world')).toEqual('helloWorld');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
'use babel';
|
||||
|
||||
import toggleClassName from '../../lib/helper/toggle-class-name';
|
||||
|
||||
describe('className toggle helper', () => {
|
||||
const root = document.documentElement;
|
||||
|
||||
it('should add a className to the root element', () => {
|
||||
expect(root.classList.contains('testClass')).toBe(false);
|
||||
toggleClassName('testClass', true);
|
||||
expect(root.classList.contains('testClass')).toBe(true);
|
||||
});
|
||||
|
||||
it('should remove a className from the root element', () => {
|
||||
expect(root.classList.contains('testClass')).toBe(true);
|
||||
toggleClassName('testClass', false);
|
||||
expect(root.classList.contains('testClass')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user