-
Notifications
You must be signed in to change notification settings - Fork 20
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
6 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const EmptyCard = props => { | ||
return ( | ||
<div className="empty-card"> | ||
<h4 className="card-message"> | ||
Uh, oh it seems there is not much to show here. | ||
</h4> | ||
<button>Add {props.itemName}</button> | ||
</div> | ||
) | ||
} | ||
|
||
EmptyCard.propTypes = { | ||
itemName: PropTypes.string.isRequired | ||
} | ||
|
||
export default EmptyCard |
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,20 @@ | ||
.empty-card { | ||
width: 100%; | ||
padding: $padding-s; | ||
color: $primary-color-white; | ||
text-align: center; | ||
background-color: $primary-color-darkblue-lighter; | ||
margin-bottom: $margin-r; | ||
border: 2px dashed rgba($primary-color-white, 0.6); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
min-height: 300px; | ||
} | ||
|
||
@media only screen and (min-width: 576px) { | ||
.empty-card { | ||
width: 48%; | ||
max-width: 400px; | ||
} | ||
} |
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,30 @@ | ||
import React from 'react' | ||
import EmptyCard from './EmptyCard' | ||
|
||
import { shallow } from 'enzyme' | ||
|
||
describe('<EmptyCard />', () => { | ||
let emptyCardWrapper | ||
|
||
let props = { | ||
itemName: 'Artist' | ||
} | ||
|
||
beforeEach(() => { | ||
emptyCardWrapper = shallow(<EmptyCard {...props} />) | ||
}) | ||
|
||
it('contains a headline that raise awareness of missing information', () => { | ||
expect(emptyCardWrapper.find('h4.card-message').text()).toEqual( | ||
'Uh, oh it seems there is not much to show here.' | ||
) | ||
}) | ||
|
||
it('contains the button which enables to create one item', () => { | ||
expect(emptyCardWrapper.find('button').length).toEqual(1) | ||
}) | ||
|
||
it('contains the button with the label of the missing item', () => { | ||
expect(emptyCardWrapper.find('button').text()).toEqual('Add Artist') | ||
}) | ||
}) |
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
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