Skip to content

Commit 9222182

Browse files
committed
Tidy up tests
1 parent 6ee17dc commit 9222182

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

immutable_app/tests/lane_reducer_test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ describe('LaneReducer', () => {
2828
};
2929
const updatedName = 'foofoo';
3030

31-
const lanes = reducer(undefined, {
31+
let lanes = reducer(undefined, {
3232
type: types.CREATE_LANE,
3333
lane: lane
3434
});
35-
const state = reducer(lanes, {
35+
lanes = reducer(lanes, {
3636
type: types.UPDATE_LANE,
3737
id: lane.id,
3838
name: updatedName
3939
});
4040

41-
assert.equal(state.count(), 1);
42-
assert.equal(state.get(0).id, lane.id);
43-
assert.equal(state.get(0).name, updatedName);
41+
assert.equal(lanes.count(), 1);
42+
assert.equal(lanes.get(0).id, lane.id);
43+
assert.equal(lanes.get(0).name, updatedName);
4444
});
4545

4646
it('should delete lanes', () => {
@@ -50,16 +50,16 @@ describe('LaneReducer', () => {
5050
notes: []
5151
};
5252

53-
const lanes = reducer(undefined, {
53+
let lanes = reducer(undefined, {
5454
type: types.CREATE_LANE,
5555
lane: lane
5656
});
57-
const state = reducer(lanes, {
57+
lanes = reducer(lanes, {
5858
type: types.DELETE_LANE,
5959
id: lane.id
6060
});
6161

62-
assert.equal(state.count(), 0);
62+
assert.equal(lanes.count(), 0);
6363
});
6464

6565
it('should attach notes to lanes', () => {
@@ -68,19 +68,19 @@ describe('LaneReducer', () => {
6868
name: 'demo lane',
6969
notes: []
7070
};
71+
const noteId = '123456';
7172

72-
const lanes = reducer(undefined, {
73+
let lanes = reducer(undefined, {
7374
type: types.CREATE_LANE,
7475
lane: lane
7576
});
76-
const noteId = '123456';
77-
const state = reducer(lanes, {
77+
lanes = reducer(lanes, {
7878
type: types.ATTACH_TO_LANE,
7979
laneId: lane.id,
8080
noteId: noteId
8181
});
8282

83-
assert.equal(state.get(0).notes[0], noteId);
83+
assert.equal(lanes.get(0).notes[0], noteId);
8484
});
8585

8686
it('should allow only one unique note per lanes when attaching', () => {
@@ -125,19 +125,19 @@ describe('LaneReducer', () => {
125125
name: 'demo lane',
126126
notes: []
127127
};
128+
const noteId = '123456';
128129

129-
const lanes = reducer(undefined, {
130+
let lanes = reducer(undefined, {
130131
type: types.CREATE_LANE,
131132
lane: lane
132133
});
133-
const noteId = '123456';
134-
const state = reducer(lanes, {
134+
lanes = reducer(lanes, {
135135
type: types.DETACH_FROM_LANE,
136136
laneId: lane.id,
137137
noteId: noteId
138138
});
139139

140-
assert.equal(state.get(0).notes.length, 0);
140+
assert.equal(lanes.get(0).notes.length, 0);
141141
});
142142

143143
it('should allow moving notes within a lane', () => {

0 commit comments

Comments
 (0)