Files
grecia/spec/components/sdg_management/subnavigation_component_spec.rb
Senén Rodero Rodríguez e9d52b5e11 Add subnavigation component to targets and goals
Add a new SDG component to make easier to create subnavigation menus.

Co-Authored-By: Javi Martín <35156+javierm@users.noreply.github.com>
2020-12-04 15:15:32 +01:00

31 lines
751 B
Ruby

require "rails_helper"
describe SDGManagement::SubnavigationComponent, type: :component do
let(:component) do
SDGManagement::SubnavigationComponent.new(current: :goals) do
"Tab content"
end
end
it "does not run Foundation component" do
render_inline component
expect(page).not_to have_css "[data-tabs]"
end
it "renders tabs and links properly styled" do
render_inline component
expect(page).to have_selector "a.is-active", text: "Goals"
expect(page).to have_selector "a:not(.is-active)", text: "Targets"
end
it "renders given block within active panel" do
render_inline component
within "#goals.tabs-panel.is-active" do
expect(page).to have_content("Tab content")
end
end
end