'use strict';

var expect = require('chai').expect;  

describe('AreaChart', function() {
  it('renders areachart', function() {
    var React = require('react/addons');
    var AreaChart = require('../src/areachart').AreaChart;
    var generate = require('../utils/datagen').generateArrayOfObjects;
    var TestUtils = React.addons.TestUtils;

    // Render a areachart using single-series data object
    var data = {
      name: 'blah',
      values: generate(5)
    };

    var areachart = TestUtils.renderIntoDocument(
      <AreaChart data={data} width={400} height={200} />
    );

    // Verify that it has the same number of areas as the data's length
    var area = TestUtils.findRenderedDOMComponentWithClass(
      areachart, 'area-path');
    expect(area.props.d).to.exist;
  });
  it('renders stacked areachart with array of objects data', function() {
    var React = require('react/addons');
    var AreaChart = require('../src/areachart').AreaChart;
    var generate = require('../utils/datagen').generateArrayOfObjects;
    var TestUtils = React.addons.TestUtils;

    // Render a areachart using data in array of objects
    var data = [
      {
        name: "series1",
        values: generate(5)
      },
      {
        name: "series2",
        values: generate(5)
      }
    ];
    var areachart = TestUtils.renderIntoDocument(
      <AreaChart data={data} width={400} height={200} />
    );

    // Verify that it has the same number of areas as the array's length
    var area = TestUtils.scryRenderedDOMComponentsWithClass(
      areachart, 'area-path');
    expect(area[0].props.d).to.exist;
  });
});

@@ -590,75 +590,196 @@
     
-// Verify that it has the same number of areas as the data's length
+var areachartGroup = TestUtils.findRenderedDOMComponentWithClass(%0A      areachart, 'rd3-areachart');%0A    expect(areachartGroup).to.exist;%0A    expect(areachartGroup.tagName).to.equal('G');%0A
 %0A   
@@ -845,36 +845,45 @@
     areachart, '
-area
+rd3-areachart
 -path');%0A    exp
@@ -910,22 +910,23 @@
 .exist;%0A
-
   %7D);%0A
+%0A
   it('re
@@ -1619,32 +1619,33 @@
 gth%0A    var area
+s
  = TestUtils.scr
@@ -1695,20 +1695,29 @@
 chart, '
-area
+rd3-areachart
 -path');
@@ -1736,30 +1736,39 @@
 area
-%5B0%5D.props.d).to.exist;
+s).to.have.length(data.length)%0A
 %0A  %7D

Use className for testing in areachart-tests.js