
var _ from 'lodash');
let sinon from 'sinon/pkg/sinon.js');
var moment from 'moment');
var TestHelpers from '../../support/TestHelpers');
var ProjectUtils from '../../../lib/js/app/utils/ProjectUtils');
var FormatUtils from '../../../lib/js/app/utils/FormatUtils');
var ProjectStore from '../../../lib/js/app/stores/ProjectStore');
var ProjectActions from '../../../lib/js/app/actions/ProjectActions');

describe('stores/ProjectStore', () => {

  beforeEach(() => {
    ProjectStore.clearAll();
  });

  describe('_create', () => {
    it('should create a new project with the default attributes', () => {
      ProjectActions.create();
      var keys = Object.keys(ProjectStore.getAll());
      assert.deepEqual(
        _.omit(ProjectStore.getAll()[keys[0]], 'id'),
        {
          loading: true,
          eventCollections: [],
          sortedEventCollections: {},
          schema: {}
        }
      );
    });
    it('should create a new project with the provided attributes', () => {
      ProjectActions.create({
        loading: false,
        schema: {
          name: 'clicks'
        }
      });
      var keys = Object.keys(ProjectStore.getAll());
      assert.deepEqual(
        _.omit(ProjectStore.getAll()[keys[0]], 'id'),
        {
          loading: false,
          eventCollections: [],
          sortedEventCollections: {},
          schema: {
            name: 'clicks'
          }
        }
      );
    });
  });

  describe('_update', () => {
    it('should update the expected project with the provided attributes', () => {
      ProjectActions.create();
      var keys = Object.keys(ProjectStore.getAll());
      ProjectActions.update(keys[0], {
        loading: false,
        schema: {
          name: 'clicks'
        }
      });
      assert.deepEqual(
        _.omit(ProjectStore.getAll()[keys[0]], 'id'),
        {
          loading: false,
          eventCollections: [],
          sortedEventCollections: {},
          schema: {
            name: 'clicks'
          }
        }
      );
    });
  });

  describe('getProject', () => {
    it('should return the first project', () => {
      ProjectActions.create();
      var keys = Object.keys(ProjectStore.getAll());
      assert.deepEqual(ProjectStore.getProject(), ProjectStore.getAll()[keys[0]]);
    });
  });

});
@@ -1,12 +1,14 @@
-%0Avar
+import
  _ from 
@@ -19,52 +19,16 @@
 ash'
-)
 ;%0A
-let sinon from 'sinon/pkg/sinon.js');%0Avar
+import
  mom
@@ -44,22 +44,24 @@
 'moment'
-)
 ;%0A
-var
+import
  TestHel
@@ -97,22 +97,24 @@
 Helpers'
-)
 ;%0A
-var
+import
  Project
@@ -164,22 +164,24 @@
 ctUtils'
-)
 ;%0A
-var
+import
  FormatU
@@ -229,22 +229,24 @@
 atUtils'
-)
 ;%0A
-var
+import
  Project
@@ -301,14 +301,16 @@
 ore'
-)
 ;%0A
-var
+import
  Pro
@@ -370,17 +370,16 @@
 Actions'
-)
 ;%0A%0Adescr
@@ -604,35 +604,37 @@
 create();%0A      
-var
+const
  keys = Object.k
@@ -671,34 +671,15 @@
     
-assert.deepEqual(%0A        
+expect(
 _.om
@@ -710,33 +710,42 @@
 %5Bkeys%5B0%5D%5D, 'id')
-,
+).toEqual(
 %0A        %7B%0A     
@@ -1072,35 +1072,37 @@
       %7D);%0A      
-var
+const
  keys = Object.k
@@ -1139,34 +1139,15 @@
     
-assert.deepEqual(%0A        
+expect(
 _.om
@@ -1178,33 +1178,42 @@
 %5Bkeys%5B0%5D%5D, 'id')
-,
+).toEqual(
 %0A        %7B%0A     
@@ -1537,35 +1537,37 @@
 create();%0A      
-var
+const
  keys = Object.k
@@ -1730,34 +1730,15 @@
     
-assert.deepEqual(%0A        
+expect(
 _.om
@@ -1777,17 +1777,26 @@
 %5D, 'id')
-,
+).toEqual(
 %0A       
@@ -2111,11 +2111,13 @@
     
-var
+const
  key
@@ -2166,24 +2166,14 @@
     
-assert.deepEqual
+expect
 (Pro
@@ -2194,18 +2194,26 @@
 roject()
-, 
+).toEqual(
 ProjectS
@@ -2252,11 +2252,12 @@
 %0A  %7D);%0A%0A
-
 %7D);
+%0A

fix tests project store