 
       describe 'when unordered', ->
         beforeEach ->
-          @sparklinesSelection = createSparklinesSelection SAMPLE_DATA_WITH_UNORDERED_DATES
+          @sparklinesSelection = createSparklinesSelection @DOMElement, SAMPLE_DATA_WITH_UNORDERED_DATES
           @sparklinesSelection.call @dateSparklines
 
         it 'should display dates in the correct order', ->

    date: new Date 2015, 8, 1
  ]

  createSparklinesSelection = (data) ->
    nestedData = d3.nest()
      .key (d) -> d.label
      .entries data

    svgElement = d3.select document.body
      .append 'svg'
      .classed 'sparklines-test-case', true


describe 'd3.toucan.sparklines', ->
  SAMPLE_DATA = [
    label: 'A'
    date: 1
