mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Improve xAxis ticks, thinner bottom margin (#4756)
* Improve xAxis ticks, thinner bottom margin * Moving utils folder * Add isTruthy
This commit is contained in:
committed by
GitHub
parent
64459efebd
commit
1e7a294c1f
43
superset/assets/spec/javascripts/utils/common_spec.jsx
Normal file
43
superset/assets/spec/javascripts/utils/common_spec.jsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { it, describe } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { isTruthy } from '../../../javascripts/utils/common';
|
||||
|
||||
describe('utils/common', () => {
|
||||
describe('isTruthy', () => {
|
||||
it('evals false-looking strings properly', () => {
|
||||
expect(isTruthy('f')).to.equal(false);
|
||||
expect(isTruthy('false')).to.equal(false);
|
||||
expect(isTruthy('no')).to.equal(false);
|
||||
expect(isTruthy('n')).to.equal(false);
|
||||
expect(isTruthy('F')).to.equal(false);
|
||||
expect(isTruthy('False')).to.equal(false);
|
||||
expect(isTruthy('NO')).to.equal(false);
|
||||
expect(isTruthy('N')).to.equal(false);
|
||||
});
|
||||
it('evals true-looking strings properly', () => {
|
||||
expect(isTruthy('t')).to.equal(true);
|
||||
expect(isTruthy('true')).to.equal(true);
|
||||
expect(isTruthy('yes')).to.equal(true);
|
||||
expect(isTruthy('y')).to.equal(true);
|
||||
expect(isTruthy('Y')).to.equal(true);
|
||||
expect(isTruthy('True')).to.equal(true);
|
||||
expect(isTruthy('Yes')).to.equal(true);
|
||||
expect(isTruthy('YES')).to.equal(true);
|
||||
});
|
||||
it('evals bools properly', () => {
|
||||
expect(isTruthy(false)).to.equal(false);
|
||||
expect(isTruthy(true)).to.equal(true);
|
||||
});
|
||||
it('evals ints properly', () => {
|
||||
expect(isTruthy(0)).to.equal(false);
|
||||
expect(isTruthy(1)).to.equal(true);
|
||||
});
|
||||
it('evals constants properly', () => {
|
||||
expect(isTruthy(null)).to.equal(false);
|
||||
expect(isTruthy(undefined)).to.equal(false);
|
||||
});
|
||||
it('string auto is false', () => {
|
||||
expect(isTruthy('false')).to.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user