       stateFieldValues: 'val1,val2,val3'
     }
     @createApp(settings).then =>
-      calcConfig = @app._getChartCalculatorConfig()
+      calcConfig = @app._buildChartCalculatorConfig()
       expect(calcConfig.stateFieldName).toBe settings.stateFieldName
       expect(calcConfig.stateFieldValues).toBe settings.stateFieldValues
+
+  it 'has correct chartStoreConfig ValidFrom date', ->
+    settings = {
+      timeFrameQuantity: '30',
+      timeFrameUnit: 'day'
+    }
+
+    @createApp(settings).then =>
+      testToday = new Date(2013, 3, 1, 0, 0, 0, 0) # April 1
+      @app._getNow = () -> testToday
+      validFrom = @app._buildChartStoreConfigValidFrom()
+      fromDate = Rally.util.DateTime.add(testToday, settings.timeFrameUnit, -settings.timeFrameQuantity);
+      expect(validFrom).toBe(fromDate.toISOString())
 
   helpers
     getContext: (initialValues) ->


  it 'has key chartAppConfig elements in the right places', ->
    @createApp().then =>
      config = @app._getChartAppConfig()
      expect(config).not.toBeNull()
      expect(config.storeConfig).not.toBeNull() # tested elsewhere
      expect(config.calculatorType).toBe 'ProjectCFDCalculator'


  it 'has correct chartStore', ->
    @createApp().then =>
      storeConfig = @app._buildChartStoreConfig()
      expect(storeConfig).not.toBeNull()
      expect(storeConfig.find.Project).toBe @project.ObjectID

