Skip to content

Commit

Permalink
Droped in some sample Spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksp committed Mar 30, 2016
1 parent 5da8172 commit 456d693
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/unit/actions/FriendsActionsSpec.js
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);
});
});
});
19 changes: 19 additions & 0 deletions test/unit/containers/FriendListAppSpec.js
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;
});
});
10 changes: 10 additions & 0 deletions test/unit/cssNullCompiler.js
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;

0 comments on commit 456d693

Please sign in to comment.