client/src/components/__tests__/NotesList.test.js
changeset 168 ea92f4fe783d
parent 3 3b5d37d84cfe
--- a/client/src/components/__tests__/NotesList.test.js	Tue Oct 09 19:07:47 2018 +0200
+++ b/client/src/components/__tests__/NotesList.test.js	Mon Oct 08 18:35:47 2018 +0200
@@ -1,22 +1,21 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import NotesList from '../NotesList';
-import Immutable from 'immutable';
 
 const setup = propOverrides => {
   const props = Object.assign({
-      notes: Immutable.List([{
-          id: 'note1',
+      notes: [{
+          _id: 'note1',
           text: 'test text 1'
         },
         {
-          id: 'note2',
+          _id: 'note2',
           text: 'test text 2'
         },
         {
-          id: 'note3',
+          _id: 'note3',
           text: 'test text 3'
-        }])
+        }]
   }, propOverrides);
 
   const wrapper = shallow(<NotesList {...props} />);
@@ -35,7 +34,7 @@
 
   test('test note nb', () => {
     const { wrapper } = setup();
-    expect(wrapper.find('Note').getNodes()).toHaveLength(3);
+    expect(wrapper.find('Note').getElements()).toHaveLength(3);
   });
 
   test('test node key', () => {
@@ -49,10 +48,9 @@
     const { wrapper } = setup();
     wrapper.find('Note').forEach((node, i) => {
       const {note} = node.props();
-      expect(note.id).toBe('note'+(i+1));
+      expect(note._id).toBe('note'+(i+1));
       expect(note.text).toBe('test text '+(i+1));
     });
   });
 
 });
-