Unify expectations on spec components folder
In this PR (https://github.com/consul/consul/pull/4683) a new syntax was introduced in the component specs to check that the component was not rendering. It seems interesting to add this syntax to the rest of the cases and thus unify the way we check that a component is not rendering.
This commit is contained in:
@@ -49,7 +49,7 @@ describe Admin::Budgets::DurationComponent do
|
||||
|
||||
render Admin::Budgets::DurationComponent.new(durable).duration
|
||||
|
||||
expect(page.text).to be_empty
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "is not defined when no start date is defined" do
|
||||
@@ -57,7 +57,7 @@ describe Admin::Budgets::DurationComponent do
|
||||
|
||||
render Admin::Budgets::DurationComponent.new(durable).duration
|
||||
|
||||
expect(page.text).to be_empty
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ describe Admin::BudgetsWizard::Headings::GroupSwitcherComponent do
|
||||
|
||||
render_inline Admin::BudgetsWizard::Headings::GroupSwitcherComponent.new(group)
|
||||
|
||||
expect(page.text).to be_empty
|
||||
expect(page).not_to have_css ".budget-group-switcher"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders a link to switch group for budgets with two groups" do
|
||||
|
||||
@@ -28,8 +28,7 @@ describe Budgets::SupportsInfoComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_selector ".supports-info"
|
||||
expect(page.text).to be_empty
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
describe "#total_supports" do
|
||||
|
||||
@@ -13,8 +13,7 @@ describe Layout::LocaleSwitcherComponent do
|
||||
it "doesn't render anything" do
|
||||
render_inline component
|
||||
|
||||
expect(page.text).to be_empty
|
||||
expect(page).not_to have_css ".locale"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ describe Layout::SocialComponent do
|
||||
|
||||
render_inline Layout::SocialComponent.new
|
||||
|
||||
expect(page).not_to have_css "ul"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ describe Layout::TopLinksComponent do
|
||||
it "does not render when no content block is defined" do
|
||||
render_inline Layout::TopLinksComponent.new
|
||||
|
||||
expect(page).not_to have_css "ul"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ describe SDG::Goals::HelpPageComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css ".sdg-help-content"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders content when the feature is enabled" do
|
||||
|
||||
@@ -14,7 +14,7 @@ describe SDG::Goals::PlainTagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "does not render when the SDG process feature is disabled" do
|
||||
|
||||
@@ -14,7 +14,7 @@ describe SDG::Goals::TagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "does not render when the SDG process feature is disabled" do
|
||||
@@ -22,7 +22,7 @@ describe SDG::Goals::TagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders a list of goals" do
|
||||
|
||||
@@ -13,9 +13,7 @@ describe SDG::Goals::TargetsComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css ".targets"
|
||||
expect(page).not_to have_css "#target_tabs"
|
||||
expect(page).not_to have_css ".tabs-content"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders tabs panel" do
|
||||
|
||||
@@ -15,7 +15,7 @@ describe SDG::RelatedListSelectorComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css ".sdg-related-list-selector"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "does not render when the SDG process feature is disabled" do
|
||||
@@ -23,7 +23,7 @@ describe SDG::RelatedListSelectorComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css ".sdg-related-list-selector"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders related_sdg_list field" do
|
||||
|
||||
@@ -18,7 +18,7 @@ describe SDG::Targets::PlainTagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "does not render when the SDG process feature is disabled" do
|
||||
@@ -26,7 +26,7 @@ describe SDG::Targets::PlainTagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders a list of targets" do
|
||||
|
||||
@@ -18,7 +18,7 @@ describe SDG::Targets::TagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "does not render when the SDG process feature is disabled" do
|
||||
@@ -26,7 +26,7 @@ describe SDG::Targets::TagListComponent do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).not_to have_css "li"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "renders a list of targets" do
|
||||
|
||||
@@ -82,13 +82,13 @@ describe Shared::BannerComponent do
|
||||
|
||||
render_inline Shared::BannerComponent.new("debates")
|
||||
|
||||
expect(page).not_to have_css ".banner"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
it "does not render anything given nil" do
|
||||
render_inline Shared::BannerComponent.new(nil)
|
||||
|
||||
expect(page).not_to have_css ".banner"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,13 +4,13 @@ describe Shared::LinkListComponent do
|
||||
it "renders nothing with an empty list" do
|
||||
render_inline Shared::LinkListComponent.new
|
||||
|
||||
expect(page).not_to have_css "ul"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "returns nothing with a list of nil elements" do
|
||||
render_inline Shared::LinkListComponent.new(nil, nil)
|
||||
|
||||
expect(page).not_to have_css "ul"
|
||||
expect(page.native.inner_html).to be_empty
|
||||
end
|
||||
|
||||
it "generates a list of links" do
|
||||
|
||||
Reference in New Issue
Block a user