forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
322 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
packages/strapi-admin/admin/src/components/OnboardingVideo/tests/index.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
packages/strapi-helper-plugin/lib/internals/generators/component/test.js.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
// import {{ properCase name }} from '../index'; | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import expect from 'expect'; | ||
// import { shallow } from 'enzyme'; | ||
// import React from 'react'; | ||
import {{ properCase name }} from '../index'; | ||
|
||
describe('<{{ properCase name }} />', () => { | ||
it('Expect to have unit tests specified', () => { | ||
expect(true).toEqual(false); | ||
it('should not crash', () => { | ||
shallow(<{{ properCase name }} />); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/strapi-plugin-content-type-builder/admin/src/components/Block/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* | ||
* Block | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './styles.scss'; | ||
|
||
function Block({ children }) { | ||
return ( | ||
<div className={styles.block}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
Block.defaultProps = { | ||
children: null, | ||
}; | ||
|
||
Block.propTypes = { | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default Block; |
6 changes: 6 additions & 0 deletions
6
packages/strapi-plugin-content-type-builder/admin/src/components/Block/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.block { | ||
padding: 1.8rem 0 0 0; | ||
border-radius: 0.2rem; | ||
background-color: #FFFFFF; | ||
box-shadow: 0 0.2rem 0.4rem 0 #E3E9F3; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/strapi-plugin-content-type-builder/admin/src/components/Block/tests/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import Block from '../index'; | ||
|
||
describe('<Block />', () => { | ||
it('should not crash', () => { | ||
shallow(<Block />); | ||
}); | ||
|
||
it('should render his children', () => { | ||
const Child = () => <div>I'm a child</div>; | ||
const wrapper = shallow(<Block><Child /></Block>); | ||
|
||
expect(wrapper.find(Child).exists()).toBe(true); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
packages/strapi-plugin-content-type-builder/admin/src/components/Flex/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* | ||
* Flex | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './styles.scss'; | ||
|
||
function Flex({ children }) { | ||
return ( | ||
<div className={styles.flex}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
Flex.defaultProps = { | ||
children: null, | ||
}; | ||
|
||
Flex.propTypes = { | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default Flex; |
5 changes: 5 additions & 0 deletions
5
packages/strapi-plugin-content-type-builder/admin/src/components/Flex/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.flex { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 0 1rem 0 2.8rem; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/strapi-plugin-content-type-builder/admin/src/components/Flex/tests/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import Flex from '../index'; | ||
|
||
describe('<Flex />', () => { | ||
it('should not crash', () => { | ||
shallow(<Flex />); | ||
}); | ||
|
||
it('should render his children', () => { | ||
const Child = () => <div>I'm a child</div>; | ||
const wrapper = shallow(<Flex><Child /></Flex>); | ||
|
||
expect(wrapper.find(Child).exists()).toBe(true); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
packages/strapi-plugin-content-type-builder/admin/src/components/ListTitle/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* | ||
* ListTitle | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import styles from './styles.scss'; | ||
|
||
function ListTitle({ children }) { | ||
return ( | ||
<div className={styles.listTitle}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
ListTitle.defaultProps = { | ||
children: null, | ||
}; | ||
|
||
ListTitle.propTypes = { | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default ListTitle; |
8 changes: 8 additions & 0 deletions
8
packages/strapi-plugin-content-type-builder/admin/src/components/ListTitle/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.listTitle { | ||
color: #333740; | ||
font-family: Lato; | ||
font-size: 1.8rem; | ||
font-weight: bold; | ||
line-height: 2.2rem; | ||
align-items: flex-start; | ||
} |
17 changes: 17 additions & 0 deletions
17
...ges/strapi-plugin-content-type-builder/admin/src/components/ListTitle/tests/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import ListTitle from '../index'; | ||
|
||
describe('<ListTitle />', () => { | ||
it('should not crash', () => { | ||
shallow(<ListTitle />); | ||
}); | ||
|
||
it('should render his children', () => { | ||
const Child = () => <div>I'm a child</div>; | ||
const wrapper = shallow(<ListTitle><Child /></ListTitle>); | ||
|
||
expect(wrapper.find(Child).exists()).toBe(true); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
packages/strapi-plugin-content-type-builder/admin/src/components/Ul/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* | ||
* Ul | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './styles.scss'; | ||
|
||
function Ul({ children, id }) { | ||
return ( | ||
<div className={styles.ul} id={id}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
Ul.defaultProps = { | ||
children: null, | ||
id: null, | ||
}; | ||
|
||
Ul.propTypes = { | ||
children: PropTypes.node, | ||
id: PropTypes.string, | ||
}; | ||
|
||
export default Ul; |
5 changes: 5 additions & 0 deletions
5
packages/strapi-plugin-content-type-builder/admin/src/components/Ul/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.ul { | ||
margin-top: 1.5rem; | ||
padding: 0; | ||
list-style: none; | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/strapi-plugin-content-type-builder/admin/src/components/Ul/tests/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import Ul from '../index'; | ||
|
||
describe('<Ul />', () => { | ||
it('should not crash', () => { | ||
shallow(<Ul />); | ||
}); | ||
|
||
it('should render its children', () => { | ||
const Child = () => <div>I'm a child</div>; | ||
const wrapper = shallow(<Ul><Child /></Ul>); | ||
|
||
expect(wrapper.find(Child).exists()).toBe(true); | ||
}); | ||
|
||
it('should adopt an id', () => { | ||
const wrapper = shallow(<Ul id="test" />); | ||
|
||
expect(wrapper.prop('id')).toBe('test'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...ages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/tests/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
// import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
// import { shallow } from 'enzyme'; | ||
|
||
import { HomePage } from '../index'; | ||
// import { HomePage } from '../index'; | ||
|
||
describe('<HomePage />', () => { | ||
|
||
let props; | ||
// let props; | ||
|
||
beforeEach(() => { | ||
props = { | ||
models: [], | ||
}; | ||
// props = { | ||
// models: [], | ||
// }; | ||
}); | ||
|
||
it('should not crash', () => { | ||
shallow(<HomePage {...props} />); | ||
// shallow(<HomePage {...props} />); | ||
}); | ||
}); |
Oops, something went wrong.