         renderer: (a,b) -> 
             received_PivotData = a
             received_rendererOptions = b
-            return $("<div>").addClass("hello").text("world")
-        rendererOptions: {a:1}
-    table = $("<div>").pivot fixtureData, pivotOptions
-
-    it "is rendered", ->
-        expect table.find("div.hello").length
+            return $("<div>").addClass(b.greeting).text("world")
+        rendererOptions: {greeting:"hithere"}
+
+    it "renders the custom renderer as per options", ->
+        expect table.find("div.hithere").length
         .toBe  1 
 
-    it "receives a PivotData object and options", ->
-        expect(received_PivotData).not.toBe  null 
-        expect(received_rendererOptions).toEqual {a: 1} 
-
-    describe "its PivotData object", ->
+    describe "its received PivotData object", ->
+        it "has correctly-ordered row and column keys", ->
+            expect received_PivotData.getRowKeys()
+            .toEqual [ [ 'Carol', 'yellow' ], [ 'Jane', 'red' ], [ 'John', 'blue' ], [ 'Nick', 'blue' ] ]
+            expect received_PivotData.getColKeys()
+            .toEqual [ [ 95, 25 ], [ 102, 14 ], [ 103, 12 ], [ 112, 30 ] ]
+
         it "has a correct grand total value and format for custom aggregator", ->
             agg = received_PivotData.getAggregator([],[])
             val = agg.value()

            expect(val).toBe 8 
            expect(agg.format(val)).toBe "formatted 8"

# TODO
# natural sort
# number format
# derivers: binning and date formatting
# locales
# sorters
# filters
# input types

            .toBe  4
            done()

describe "$.pivotUI() with specified rows/cols, sum-over-sum aggregator, Heatmap renderer",  ->
    table = null

    beforeEach (done) ->
        table = $("<div>").pivotUI fixtureData, 
            rows: ["gender"], cols: ["colour"]
            aggregatorName: "Sum over Sum"
            vals: ["successes", "trials"]
            rendererName: "Heatmap"
            onRefresh: done

    it "has all the basic UI elements", (done) ->
        expect table.find("td.pvtAxisContainer").length
