"use strict";

var test = require('tape')
  , Immutable = require('immutable')

test('Activities helpers', function (t) {
  var activitiesHelpers = require('../helpers/activities')
    , activitiesData = require('./fixtures/activity_list.json')

  activitiesData = Immutable.fromJS(activitiesData)

  t.plan(1)

  t.deepEqual(
    activitiesHelpers.groupActivities(activitiesData).toJS(),
    [
      {
        count: 2,
        mostRecent: {
          "user": "patrick",
          "project": "patrick_research",
          "time": "2015-09-28T14:30:59.277143",
          "type": "note",
          "url": "/projects/patrick_research/notes/17/",
          "title": "My first note",
          "action": "changed"
        },
        times: ["2015-09-28T14:30:59.277143", "2015-09-28T14:30:03.566247"]
      },
      {
        count: 1,
        mostRecent: {
          "user": "p",
          "project": "patrick_research",
          "time": "2015-09-28T11:29:53.710729",
          "type": "topic",
          "url": "/projects/patrick_research/topics/8/",
          "title": "DSflkjasd",
          "action": "added"
        },
        times: ["2015-09-28T11:29:53.710729"]
      },
      {
        count: 1,
        mostRecent: {
          "user": "p",
          "project": "patrick_research",
          "time": "2015-09-28T14:29:48.158976",
          "type": "note",
          "url": "/projects/patrick_research/notes/17/",
          "title": "My first note",
          "action": "added"
        },
        times: ["2015-09-28T14:29:48.158976"]
      }
    ]
  )
});

@@ -414,16 +414,76 @@
 unt: 2,%0A
+        id: %22changed%7C/projects/patrick_research/notes/17/%22,%0A
         
@@ -488,32 +488,32 @@
   mostRecent: %7B%0A
-
           %22user%22
@@ -877,32 +877,90 @@
       count: 1,%0A
+        id: %22added%7C/projects/patrick_research/topics/8/%22,%0A
         mostRece
@@ -1287,32 +1287,32 @@
      %7D,%0A      %7B%0A
-
         count: 1
@@ -1305,32 +1305,90 @@
       count: 1,%0A
+        id: %22added%7C/projects/patrick_research/notes/17/%22,%0A
         mostRece

Update activity aggregation test