-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from kyan/1_tracklength_playlist
- Add track length to playlist items - Plumb specs and create a couple to get the ball rolling
- Loading branch information
Showing
11 changed files
with
617 additions
and
2,428 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 @@ | ||
# Kyan Jukebox API |
Large diffs are not rendered by default.
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
30 changes: 30 additions & 0 deletions
30
frontend/src/components/current-track/__snapshots__/index.spec.js.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CurrentTrack render renders the as expected 1`] = ` | ||
<Card> | ||
<Image | ||
as="img" | ||
src="path/to/image" | ||
ui={true} | ||
/> | ||
<CardContent> | ||
<Progress | ||
percent={25} | ||
size="tiny" | ||
/> | ||
<CardHeader> | ||
My Track Title | ||
</CardHeader> | ||
<CardMeta> | ||
( | ||
0:13 | ||
) | ||
Artist Name | ||
</CardMeta> | ||
<CardDescription> | ||
Album Name | ||
</CardDescription> | ||
</CardContent> | ||
</Card> | ||
`; |
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 |
---|---|---|
|
@@ -29,5 +29,4 @@ CurrentTrack.propTypes = { | |
progress: PropTypes.number | ||
} | ||
|
||
|
||
export default CurrentTrack |
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,33 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import { shallowToJson } from 'enzyme-to-json' | ||
import CurrentTrack from './index' | ||
|
||
describe('CurrentTrack', () => { | ||
let wrapper | ||
let track = { | ||
name: 'My Track Title', | ||
length: 12999, | ||
artist: { | ||
name: 'Artist Name' | ||
}, | ||
album: { | ||
name: 'Album Name' | ||
} | ||
} | ||
const image = 'path/to/image' | ||
|
||
describe('render', () => { | ||
wrapper = shallow( | ||
<CurrentTrack | ||
track={ track } | ||
image={ image } | ||
progress={ 25 } | ||
/> | ||
) | ||
|
||
it('renders the as expected', () => { | ||
expect(shallowToJson(wrapper)).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
61 changes: 61 additions & 0 deletions
61
frontend/src/components/tracklist/__snapshots__/index.spec.js.snap
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,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Tracklist render renders the as expected 1`] = ` | ||
<List | ||
size="large" | ||
> | ||
<ListItem | ||
className="track-selected" | ||
key="0-track1" | ||
> | ||
<Image | ||
as="img" | ||
avatar={true} | ||
src="path/to/image" | ||
ui={true} | ||
/> | ||
<ListContent> | ||
<ListHeader | ||
as="a" | ||
> | ||
Track Title 1 | ||
<small> | ||
( | ||
0:13 | ||
) | ||
</small> | ||
</ListHeader> | ||
<ListDescription> | ||
Artist Name 1 | ||
</ListDescription> | ||
</ListContent> | ||
</ListItem> | ||
<ListItem | ||
className="" | ||
key="1-track2" | ||
> | ||
<Image | ||
as="img" | ||
avatar={true} | ||
ui={true} | ||
/> | ||
<ListContent> | ||
<ListHeader | ||
as="a" | ||
> | ||
Track Title 2 | ||
<small> | ||
( | ||
0:23 | ||
) | ||
</small> | ||
</ListHeader> | ||
<ListDescription> | ||
Artist Name 2 | ||
</ListDescription> | ||
</ListContent> | ||
</ListItem> | ||
</List> | ||
`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import { shallowToJson } from 'enzyme-to-json' | ||
import Tracklist from './index' | ||
|
||
describe('Tracklist', () => { | ||
let wrapper | ||
let tracks = [ | ||
{ | ||
uri: 'track1', | ||
name: 'Track Title 1', | ||
length: 12999, | ||
artist: { | ||
name: 'Artist Name 1' | ||
}, | ||
album: { | ||
uri: 'album1', | ||
name: 'Album Name 1' | ||
} | ||
}, | ||
{ | ||
uri: 'track2', | ||
name: 'Track Title 2', | ||
length: 22999, | ||
artist: { | ||
name: 'Artist Name 2' | ||
}, | ||
album: { | ||
uri: 'album2', | ||
name: 'Album Name 2' | ||
} | ||
} | ||
] | ||
const images = { | ||
'album1': 'path/to/image' | ||
} | ||
|
||
describe('render', () => { | ||
wrapper = shallow( | ||
<Tracklist | ||
tracks={tracks} | ||
images={images} | ||
currentTrack={tracks[0]} | ||
/> | ||
) | ||
|
||
it('renders the as expected', () => { | ||
expect(shallowToJson(wrapper)).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
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,4 @@ | ||
import { configure } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
|
||
configure({ adapter: new Adapter() }); |
Oops, something went wrong.