import assert      from 'assert';
import GroceryList from '../../src/es6/05-Challenge-GroceryList.js';
import jsdom       from 'jsdom';
import React       from 'react/addons';
import _           from 'lodash';

describe("05 - Challenge - Grocery List", () => {
  var component;

  beforeEach( () => {
    var elem = document.createElement('div');
    elem = document.body.appendChild(elem);
    component = React.render(React.createElement(GroceryList), elem);
  });

  afterEach( () => {
    React.unmountComponentAtNode(React.findDOMNode(component));
  });

  describe("Task #1 - display a list of groceries", () => {
    it('There should be an unordered list of groceries', () => {
      let rootElement = React.findDOMNode(component);

      assert.equal(rootElement.nodeName, "UL", "list of groceries should be an unordered list (<ul> tag)");

      let groceryListItems = React.addons.TestUtils.scryRenderedDOMComponentsWithTag(
        component, "li"
      );

      assert.equal(groceryListItems.length, 1, "there should be exactly one element on the list");

      let groceryItem = _.first(groceryListItems);
      assert.equal(groceryItem.props.children, "Test", "there should be a name of grocery in a list item"); 
    });
  });
});

@@ -781,33 +781,25 @@
  %22UL%22, %22
-list of g
+G
 roceries
  should 
@@ -790,24 +790,28 @@
 roceries
+List
  should 
 be an un
@@ -798,39 +798,35 @@
 List should 
-be an unordered
+render HTML
  list (%3Cul%3E 
@@ -828,12 +828,8 @@
 %3Cul%3E
- tag
 )%22);
@@ -919,17 +919,8 @@
 Tag(
-%0A        
 comp
@@ -930,23 +930,16 @@
 nt, %22li%22
-%0A      
 );%0A%0A    
@@ -982,17 +982,17 @@
 th, 1, %22
-t
+T
 here sho
@@ -1025,16 +1025,26 @@
  on the 
+groceries 
 list%22);%0A
@@ -1155,56 +1155,55 @@
 %22, %22
-there should be a name of grocery in a list item
+GroceriesListItem should display a grocery name
 %22); 

Modify tests messages for first task on exercise #5