1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-04 21:15:19 +02:00

Bring back tests for trends where current is nil

This commit is contained in:
Jose Farias 2024-04-18 20:40:16 -06:00
parent 9aa975cc90
commit c041f4f6c0

View file

@ -24,4 +24,13 @@ class TimeSeries::TrendTest < ActiveSupport::TestCase
test "infinitely up" do
assert_equal "up", TimeSeries::Trend.new(current: 100, previous: 0).direction
end
test "infinitely down" do
assert_equal "down", TimeSeries::Trend.new(current: nil, previous: 100).direction
assert_equal "down", TimeSeries::Trend.new(current: 0, previous: 100).direction
end
test "empty" do
assert_equal "flat", TimeSeries::Trend.new(current: nil, previous: nil).direction
end
end