forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rubyforgood#5777] Add spec for step navigation component
- Loading branch information
1 parent
2308e72
commit 11fba79
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe Form::StepNavigationComponent, type: :component do | ||
context "can handle enabled button" do | ||
it "enables button if value exists" do | ||
render_inline(described_class.new(nav_back: '/details')) | ||
expect(page).to have_selector(:link_or_button, 'Back step') | ||
end | ||
end | ||
|
||
context "can handle disabled button" do | ||
it "disables buttons if value is nil" do | ||
render_inline(described_class.new()) | ||
expect(page).not_to have_selector(:link_or_button, 'Next step') | ||
end | ||
end | ||
end |