Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Switch out uslug for lodash.kebabcase. Saves about 200kb unminified
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Jan 9, 2018
1 parent e8d5406 commit 7ad7d74
Show file tree
Hide file tree
Showing 4 changed files with 1,658 additions and 496 deletions.
30 changes: 15 additions & 15 deletions packages/api-explorer-ui/__tests__/block-types/ApiHeader.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ const React = require('react');
const { shallow } = require('enzyme');
const ApiHeader = require('../../src/block-types/ApiHeader');

const block = {
type: 'api-header',
data: {
title: 'This is header',
type: 'post',
},
};

describe('ApiHeader', () => {
test('Api Header will render text in table header cells', () => {
const block = {
type: 'api-header',
data: {
title: 'This is header',
},
};
const apiHeader = shallow(<ApiHeader block={block} />);
expect(apiHeader.find('h1').text()).toBe('This is header');
});

test('should render with the type in a span', () => {
const type = 'post';
const block = {
type: 'api-header',
data: {
title: 'This is header',
type,
},
};
const apiHeader = shallow(<ApiHeader block={block} />);
expect(apiHeader.find(`span.type-${type}`).length).toBe(1);
expect(apiHeader.find(`span.type-${block.data.type}`).length).toBe(1);
});

test('should create an #id with the slug of the title', () => {
const apiHeader = shallow(<ApiHeader block={block} />);
expect(apiHeader.find(`span#this-is-header`).length).toBe(1);
expect(apiHeader.find(`#section-this-is-header`).length).toBe(1);
});
});
Loading

0 comments on commit 7ad7d74

Please sign in to comment.