require "rails_helper"

module GraphicsElements
  RSpec.describe GraphicsElementsPresenter do
    describe "#present" do
      describe "graphics_elements" do
        it "returns graphics_elements sorted by appears_at" do
          graphics_elements = [
            build(:graphics_element, time_elapsed: 0),
            build(:graphics_element, time_elapsed: 50),
            build(:graphics_element, time_elapsed: 10),
          ]

          results = subject.present(graphics_elements).graphics_elements

          expect(results.map(&:appears_at)).to eq ["00:00:00:00", "00:00:10:00", "00:00:50:00"]
        end
      end
    end
  end
end
