From 357191484d31e36becc84415a8e48f82f7b53772 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 17:04:47 -0500 Subject: [PATCH] Updating tests. --- .../coral-framework/store/itemActions.spec.js | 12 +++++++----- tests/models/action.js | 16 ++-------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/tests/client/coral-framework/store/itemActions.spec.js b/tests/client/coral-framework/store/itemActions.spec.js index 46650c592..a6f14b65f 100644 --- a/tests/client/coral-framework/store/itemActions.spec.js +++ b/tests/client/coral-framework/store/itemActions.spec.js @@ -29,21 +29,23 @@ describe('itemActions', () => { ], actions: [ { - type: 'like', - id: '123', + action_type: 'like', + item_id: '123', count: 1, + id: 'like_123', current_user: false }, { - type: 'flag', - id: '456', + action_type: 'flag', + item_id: '456', count: 5, + id: 'flag_456', current_user: true } ] }; - it('should get an stream from an asset_id and send the appropriate dispatches', () => { + it('should get an stream from an asset_url and send the appropriate dispatches', () => { fetchMock.get('*', JSON.stringify(response)); return actions.getStream(assetUrl)(store.dispatch) .then((res) => { diff --git a/tests/models/action.js b/tests/models/action.js index 80a8ae814..78f5fd1d0 100644 --- a/tests/models/action.js +++ b/tests/models/action.js @@ -10,10 +10,6 @@ describe('Action: models', () => { action_type: 'flag', item_id: '123', item_type: 'comments' - }, { - action_type: 'like', - item_id: '789', - item_type: 'comments' }, { action_type: 'flag', item_id: '456', @@ -51,19 +47,11 @@ describe('Action: models', () => { describe('#getActionSummaries()', () => { it('should return properly formatted summaries from an array of item_ids', () => { return Action.getActionSummaries(['123', '789']).then((result) => { - expect(result).to.have.length(3); + expect(result).to.have.length(2); const sorted = result.sort((a, b) => a.count - b.count); expect(sorted[0]).to.deep.equal({ - action_type: 'like', - count: 1, - item_id: '789', - item_type: 'comments', - current_user: false - }); - - expect(sorted[1]).to.deep.equal({ action_type: 'like', count: 1, item_id: '123', @@ -71,7 +59,7 @@ describe('Action: models', () => { current_user: false }); - expect(sorted[2]).to.deep.equal({ + expect(sorted[1]).to.deep.equal({ action_type: 'flag', count: 2, item_id: '123',