You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
660 B
20 lines
660 B
3 years ago
|
require "rails_helper"
|
||
|
|
||
|
RSpec.describe DocumentListComponent, type: :component do
|
||
|
let(:items) do
|
||
|
[{ name: "PDF Form", href: "/forms/form.pdf", description: "An important form", metadata: "4 pages" },
|
||
|
{ name: "Website", href: "https://example.com" }]
|
||
|
end
|
||
|
|
||
|
context "when rendering tabs" do
|
||
|
it "all of the nav tabs specified in the items hash are passed to it" do
|
||
|
result = render_inline(described_class.new(items:))
|
||
|
|
||
|
expect(result.text).to include("PDF Form")
|
||
|
expect(result.text).to include("An important form")
|
||
|
expect(result.text).to include("4 pages")
|
||
|
expect(result.text).to include("Website")
|
||
|
end
|
||
|
end
|
||
|
end
|