* Move featureClassNames to js util * Add tests for featureClassNames * Strip empty feature class names * Move canToggleDomain to js util * Add tests for canToggleDomain * Refactor canToggleDomain to ensure boolean return * Switch to chai assert for richer syntax options * Move canToggleState to js util * Tests for canToggleState * Enable linting for mocha tests * Move stateCardType to js util * Add tests for stateCardType * Move stateMoreInfoType to js util * Tests for stateMoreInfoType * Include mdn Array includes polyfill
13 lines
437 B
JavaScript
13 lines
437 B
JavaScript
import { assert } from 'chai';
|
|
|
|
import computeDomain from '../../../js/common/util/compute_domain';
|
|
|
|
describe('computeDomain', () => {
|
|
it('Returns domains', () => {
|
|
assert.equal(computeDomain('sensor.bla'), 'sensor');
|
|
assert.equal(computeDomain('switch.bla'), 'switch');
|
|
assert.equal(computeDomain('light.bla'), 'light');
|
|
assert.equal(computeDomain('persistent_notification.bla'), 'persistent_notification');
|
|
});
|
|
});
|