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

Commit

Permalink
Run prettier on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Sep 13, 2017
1 parent 2bb2014 commit 9639c07
Show file tree
Hide file tree
Showing 20 changed files with 1,493 additions and 1,642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { shallow } = require('enzyme');
const ApiHeader = require('../../src/block-types/ApiHeader');


describe('ApiHeader', () => {
test('Api Header will render text in table header cells', () => {
const block = {
Expand Down
10 changes: 6 additions & 4 deletions packages/api-explorer-ui/__tests__/block-types/CallOut.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { shallow, mount } = require('enzyme');
const CallOut = require('../../src/block-types/CallOut');


describe('CallOut', () => {
test('Call out will render title if given in props', () => {
const block = {
Expand All @@ -11,7 +10,8 @@ describe('CallOut', () => {
type: 'info',
title: 'Callout',
},
sidebar: undefined };
sidebar: undefined,
};
const callOutInput = mount(<CallOut block={block} />);
expect(callOutInput.find('h3').text()).toBe('Callout');
});
Expand All @@ -22,7 +22,8 @@ describe('CallOut', () => {
data: {
type: 'info',
},
sidebar: undefined };
sidebar: undefined,
};
const callOutInput = mount(<CallOut block={block} />);
expect(callOutInput.find('span').text()).toBe('');
});
Expand All @@ -34,7 +35,8 @@ describe('CallOut', () => {
type: 'info',
body: 'you are incorrect',
},
sidebar: undefined };
sidebar: undefined,
};

const callOutInput = shallow(<CallOut block={block} />);
expect(callOutInput.find('div.callout-body').text()).toBe('you are incorrect');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { mount } = require('enzyme');
const Code = require('../../src/block-types/Code');


describe('Code', () => {
test('Code will render name if provided within em tag', () => {
const block = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Content', () => {
'callout',
'parameters',
'image',
].forEach((type) => {
].forEach(type => {
expect(content.find(`.magic-block-${type}`).length).toBe(1);
});
});
Expand Down
8 changes: 5 additions & 3 deletions packages/api-explorer-ui/__tests__/block-types/Embed.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { shallow } = require('enzyme');
const Embed = require('../../src/block-types/Embed');


describe('Embed', () => {
test('Embed will have src property if iframe is true', () => {
const block = {
Expand All @@ -20,11 +19,14 @@ describe('Embed', () => {
sidebar: undefined,
};
const embedInput = shallow(<Embed block={block} />);
expect(embedInput.find('iframe').prop('src')).toBe('http://jsbin.com/fewilipowi/edit?js,output');
expect(embedInput.find('iframe').prop('src')).toBe(
'http://jsbin.com/fewilipowi/edit?js,output',
);
});

test('Embed will have no text property if iframe is false', () => {
const url = '<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjYjDqzZ4gjY%3Ffeature%3Doembed&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjYjDqzZ4gjY&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjYjDqzZ4gjY%2Fhqdefault.jpg&key=f2aa6fc3595946d0afc3d76cbbd25dc3&type=text%2Fhtml&schema=youtube" width="640" height="480" scrolling="no" frameborder="0" allowfullscreen></iframe>';
const url =
'<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjYjDqzZ4gjY%3Ffeature%3Doembed&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjYjDqzZ4gjY&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjYjDqzZ4gjY%2Fhqdefault.jpg&key=f2aa6fc3595946d0afc3d76cbbd25dc3&type=text%2Fhtml&schema=youtube" width="640" height="480" scrolling="no" frameborder="0" allowfullscreen></iframe>';
const block = {
type: 'embed',
data: {
Expand Down
39 changes: 32 additions & 7 deletions packages/api-explorer-ui/__tests__/block-types/Image.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,46 @@ describe('Image', () => {
test('Image has a tag with property href set to url', () => {
const block = {
type: 'image',
data: { images:
[{ image: ['https://files.readme.io/924824e-fullsizeoutput_314.jpeg', 'fullsizeoutput_314.jpeg', 640, 1136, '#c8b396'] }],
data: {
images: [
{
image: [
'https://files.readme.io/924824e-fullsizeoutput_314.jpeg',
'fullsizeoutput_314.jpeg',
640,
1136,
'#c8b396',
],
},
],
},
sidebar: undefined };
sidebar: undefined,
};
const imageInput = shallow(<Image block={block} />);

expect(imageInput.find('a').prop('href')).toBe('https://files.readme.io/924824e-fullsizeoutput_314.jpeg');
expect(imageInput.find('a').prop('href')).toBe(
'https://files.readme.io/924824e-fullsizeoutput_314.jpeg',
);
});
test('Image will render caption if given in props', () => {
const block = {
type: 'image',
data: { images:
[{ image: ['https://files.readme.io/924824e-fullsizeoutput_314.jpeg', 'fullsizeoutput_314.jpeg', 640, 1136, '#c8b396'], caption: 'doggo' }],
data: {
images: [
{
image: [
'https://files.readme.io/924824e-fullsizeoutput_314.jpeg',
'fullsizeoutput_314.jpeg',
640,
1136,
'#c8b396',
],
caption: 'doggo',
},
],
},
sidebar: undefined };
sidebar: undefined,
};

const imageInput = shallow(<Image block={block} />);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { shallow } = require('enzyme');
const Parameters = require('../../src/block-types/Parameters');


describe('Parameters', () => {
test('Parameters will render text in table header cells', () => {
const block = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const React = require('react');
const { shallow } = require('enzyme');
const TextArea = require('../../src/block-types/TextArea');


describe('TextArea', () => {
test('Text area will output text', () => {
const block = {
Expand Down
Loading

0 comments on commit 9639c07

Please sign in to comment.