mirror of
https://github.com/thangisme/notes.git
synced 2024-11-01 01:27:31 -04:00
76 lines
1.6 KiB
JavaScript
76 lines
1.6 KiB
JavaScript
/* eslint-disable max-nested-callbacks */
|
|
|
|
import {
|
|
expect
|
|
} from 'chai';
|
|
import makeConfig from './../src/makeConfig';
|
|
|
|
describe('makeConfig', () => {
|
|
it('does not affect the parameter configuration object', () => {
|
|
const config = {};
|
|
|
|
makeConfig([
|
|
[
|
|
'aaaaa'
|
|
]
|
|
], config);
|
|
|
|
expect(config).to.deep.equal({});
|
|
});
|
|
|
|
context('column', () => {
|
|
context('"alignment"', () => {
|
|
context('is not provided', () => {
|
|
it('defaults to "left"', () => {
|
|
const config = makeConfig([
|
|
[
|
|
'aaaaa'
|
|
]
|
|
]);
|
|
|
|
expect(config.columns[0].alignment).to.equal('left');
|
|
});
|
|
});
|
|
});
|
|
context('"width"', () => {
|
|
context('is not provided', () => {
|
|
it('defaults to the maximum column width', () => {
|
|
const config = makeConfig([
|
|
[
|
|
'aaaaa'
|
|
]
|
|
]);
|
|
|
|
expect(config.columns[0].width).to.equal(5);
|
|
});
|
|
});
|
|
});
|
|
context('"paddingLeft"', () => {
|
|
context('is not provided', () => {
|
|
it('defaults to 1', () => {
|
|
const config = makeConfig([
|
|
[
|
|
'aaaaa'
|
|
]
|
|
]);
|
|
|
|
expect(config.columns[0].paddingLeft).to.equal(1);
|
|
});
|
|
});
|
|
});
|
|
context('"paddingRight"', () => {
|
|
context('is not provided', () => {
|
|
it('defaults to 1', () => {
|
|
const config = makeConfig([
|
|
[
|
|
'aaaaa'
|
|
]
|
|
]);
|
|
|
|
expect(config.columns[0].paddingRight).to.equal(1);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|