mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(lib): add test for cx
This commit is contained in:
parent
299426191e
commit
5726e99d92
1 changed files with 10 additions and 0 deletions
10
src/lib/__tests__/cx.spec.js
Normal file
10
src/lib/__tests__/cx.spec.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { cx } from '../cx';
|
||||
|
||||
test('cx', () => {
|
||||
expect(cx(null)).toEqual('');
|
||||
expect(cx(undefined)).toEqual('');
|
||||
expect(cx('--')).toEqual('bx--');
|
||||
expect(cx('--', null)).toEqual('bx--');
|
||||
expect(cx(0, undefined, '--', null, 1)).toEqual('bx--');
|
||||
expect(cx(1 && '1', 0 && '0')).toEqual('1');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue