-
Notifications
You must be signed in to change notification settings - Fork 5
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
3 changed files
with
74 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,45 @@ | ||
import { expect } from '../testHelper'; | ||
import * as types from '../../../src/js/constants/ActionTypes'; | ||
import { addFriend, deleteFriend, starFriend } from '../../../src/js/actions/FriendsActions'; | ||
|
||
describe('Actions', () => { | ||
|
||
describe('addFriend', () => { | ||
|
||
it('has the correct type', () => { | ||
const action = addFriend(); | ||
expect(action.type).to.equal(types.ADD_FRIEND); | ||
}); | ||
|
||
it('has the correct payload', () => { | ||
const action = addFriend('Eminem'); | ||
expect(action.name).to.equal('Eminem'); | ||
}); | ||
}); | ||
|
||
describe('deleteFriend', () => { | ||
|
||
it('has the correct type', () => { | ||
const action = deleteFriend(); | ||
expect(action.type).to.equal(types.DELETE_FRIEND); | ||
}); | ||
|
||
it('has the correct payload', () => { | ||
const action = deleteFriend(0); | ||
expect(action.id).to.equal(0); | ||
}); | ||
}); | ||
|
||
describe('starFriend', () => { | ||
|
||
it('has the correct type', () => { | ||
const action = starFriend(); | ||
expect(action.type).to.equal(types.STAR_FRIEND); | ||
}); | ||
|
||
it('has the correct payload', () => { | ||
const action = starFriend(1); | ||
expect(action.id).to.equal(1); | ||
}); | ||
}); | ||
}); |
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 { renderComponent, expect } from '../testHelper'; | ||
import FriendListApp from '../../../src/js/containers/FriendListApp/FriendListApp'; | ||
|
||
describe('FriendListApp', () => { | ||
|
||
let component; | ||
|
||
beforeEach(() => { | ||
component = renderComponent(FriendListApp); | ||
}); | ||
|
||
it('shows an input to add a new friend', () => { | ||
expect(component.find('.addFriendInput')).to.exist; | ||
}); | ||
|
||
it('shows a friend list', () => { | ||
expect(component.find('.friendList')).to.exist; | ||
}); | ||
}); |
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,10 @@ | ||
function noop() { | ||
return null; | ||
} | ||
|
||
require.extensions['.styl'] = noop; | ||
require.extensions['.scss'] = noop; | ||
require.extensions['.less'] = noop; | ||
require.extensions['.jpg'] = noop; | ||
require.extensions['.png'] = noop; | ||
require.extensions['.woff'] = noop; |