Skip to content

Commit

Permalink
Fix ToggleSwitch preview (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank authored Jul 13, 2023
1 parent f2dd086 commit 148e6fe
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions previews/primer/alpha/toggle_switch_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,54 @@ class ToggleSwitchPreview < ViewComponent::Preview
include ActionView::Helpers::FormTagHelper

def playground
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
end

# @snapshot
def default
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
end

# @snapshot
def checked
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true))
end

# @snapshot
def disabled
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, enabled: false))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, enabled: false))
end

# @snapshot
def checked_disabled
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true, enabled: false))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true, enabled: false))
end

# @snapshot
def small
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, size: :small))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, size: :small))
end

# @snapshot
def with_status_label_position_end
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, status_label_position: :end))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, status_label_position: :end))
end

# @snapshot
def with_a_bad_src
render(ToggleSwitch.new(src: "/foo"))
render(Primer::Alpha::ToggleSwitch.new(src: "/foo"))
end

def with_no_src
render(ToggleSwitch.new)
render(Primer::Alpha::ToggleSwitch.new)
end

def with_csrf_token
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "let_me_in"))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "let_me_in"))
end

def with_bad_csrf_token
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "i_am_a_criminal"))
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "i_am_a_criminal"))
end
end
end
Expand Down

0 comments on commit 148e6fe

Please sign in to comment.