diff --git a/test/pages/test_awards.rb b/test/pages/test_awards.rb index 79a7c0cc..ddad6333 100644 --- a/test/pages/test_awards.rb +++ b/test/pages/test_awards.rb @@ -45,7 +45,7 @@ def test_fn_payables ", 'today' => (Time.now - (10 * 60 * 60)).utc.iso8601 ) - assert_equal('55', xml.xpath('/td/text()').to_s, xml) + assert_equal('30', xml.xpath('/td/text()').to_s, xml) end def test_fn_payables_out_of_window @@ -81,6 +81,39 @@ def test_fn_payables_out_of_window assert_equal('75', xml.xpath('/td/text()').to_s, xml) end + def test_fn_payables_excludes_future_awards_for_historical_report + xml = xslt( + "", + ' + + + reconciliation + 2024-05-31T00:00:00Z + 2024-05-01T00:00:00Z + dude + 0 + 0 + 0 + + + 1 + 2024-06-01T00:00:00Z + dude + 10 + + + 1 + 2024-06-03T00:00:00Z + dude + 50 + + + ', + 'today' => '2024-06-02T00:00:00Z' + ) + assert_equal('10', xml.xpath('/td/text()').to_s, xml) + end + def test_fn_payables_with_few_reconciliations xml = xslt( "", @@ -126,7 +159,7 @@ def test_fn_payables_with_few_reconciliations ", 'today' => (Time.now - (10 * 60 * 60)).utc.iso8601 ) - assert_equal('55', xml.xpath('/td/text()').to_s, xml) + assert_equal('30', xml.xpath('/td/text()').to_s, xml) end def test_fn_payables_uses_latest_reconciliation_when_facts_are_out_of_order diff --git a/xsl/awards.xsl b/xsl/awards.xsl index 469596cb..5599729a 100644 --- a/xsl/awards.xsl +++ b/xsl/awards.xsl @@ -55,7 +55,7 @@ - +