Skip to content

Commit

Permalink
Update ffe-grid to 5.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristofer Selbekk committed Nov 28, 2017
1 parent c9a51a9 commit 43e47ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## Version 5.0.1
* Removed now unnecessary class `ffe-grid__col` from markup

## Version 5.0.0
* BREAKING: All `bg*` have been removed, and are replaced by a single `background` prop, which accepts a dash-cased value. Please see the README for a complete list of valid values. Upgrading requires the consumer to i.e. replace `bgBlueIce={true}` with `background="blue-ice"`.
* Added `mint-green` as a valid background value
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffe-grid-react",
"version": "5.0.0",
"version": "5.0.1",
"main": "lib/index.js",
"scripts": {
"build": "babel -d lib/. --ignore=*.test.js src/. && npm run example",
Expand All @@ -20,7 +20,7 @@
"classnames": "^2.2.5"
},
"peerDependencies": {
"ffe-grid": "^5.4.0"
"ffe-grid": "^5.6.0"
},
"devDependencies": {
"babel-cli": "^6.18.0",
Expand All @@ -40,7 +40,7 @@
"eslint-plugin-react": "^6.9.0",
"expect.js": "^0.3.1",
"ffe-core": "^9.2.0",
"ffe-grid": "^5.0.0",
"ffe-grid": "^5.6.0",
"jsdom": "^11.2.0",
"mocha": "^3.2.0",
"nsp": "^2.6.2",
Expand Down
1 change: 0 additions & 1 deletion src/GridCol.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export default class GridCol extends Component {

const classes = [
className,
'ffe-grid__col',
sizeClasses('lg', lg),
sizeClasses('md', md),
sizeClasses('sm', !sm && !lg && !md ? 12: sm),
Expand Down
18 changes: 0 additions & 18 deletions src/test/GridCol.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ const defaultProps = {
const renderShallow = (props = {}) => shallow(<GridCol {...defaultProps} {...props} />);

describe('GridCol', () => {
it('renders with default class', () => {
const el = renderShallow();

expect(el.prop('className')).to.contain('ffe-grid__col');
expect(el.type()).to.be('div');
});

it('renders with custom class', () => {
const el = renderShallow({ className: 'custom-class' });
expect(el.hasClass('custom-class')).to.be(true);
Expand All @@ -32,71 +25,61 @@ describe('GridCol', () => {
it('supports setting cols as a number', () => {
const el = renderShallow({ lg: 10 });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--lg-10')).to.be(true);
});

it('supports setting cols as a string', () => {
const el = renderShallow({ sm: '1' });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--sm-1')).to.be(true);
});

it('supports setting cols as an object', () => {
const el = renderShallow({ md: { cols: 4 } });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--md-4')).to.be(true);
});

it('supports setting cols and offset', () => {
const el = renderShallow({ sm: { cols: 4, offset: '2' } });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--sm-4')).to.be(true);
expect(el.hasClass('ffe-grid__col--sm-offset-2')).to.be(true);
});

it('does not set an offset class if no offset is provided', () => {
const el = renderShallow({ lg: { cols: 7 } });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.prop('className')).to.not.contain('offset');
});

it('sets the center modifier if the value is boolean true', () => {
const el = renderShallow({ center: true });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--center')).to.be(true);
});

it('sets the center modifier as a string', () => {
const el = renderShallow({ center: 'true' });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--center')).to.be(true);
});

it('sets the center modifier if the value is truthy', () => {
const el = renderShallow({ center: 'wombats' });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--center')).to.be(true);
});

it('does not set the center modifier if the value is boolean false', () => {
const el = renderShallow({ center: false });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--center')).not.to.be(true);
});

it('sets the top modifier', () => {
const el = renderShallow({ top: true });

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--top')).to.be(true);
});

Expand All @@ -112,7 +95,6 @@ describe('GridCol', () => {
reverse: true,
});

expect(el.hasClass('ffe-grid__col')).to.be(true);
expect(el.hasClass('ffe-grid__col--sm-6')).to.be(true);
expect(el.hasClass('ffe-grid__col--sm-offset-2')).to.be(true);
expect(el.hasClass('ffe-grid__col--md-8')).to.be(true);
Expand Down

0 comments on commit 43e47ac

Please sign in to comment.