Skip to content

Commit

Permalink
[PLAY-1516] Make Rails icons fixed-width (#3656)
Browse files Browse the repository at this point in the history
**What does this PR do?** A clear and concise description with your
runway ticket url.
https://runway.powerhrg.com/backlog_items/PLAY-1516

**Screenshots:** Screenshots to visualize your addition/change


**How to test?** Steps to confirm the desired behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See addition/change


#### Checklist:
- [ ] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [ ] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [ ] **TESTS** I have added test coverage to my code.

---------

Co-authored-by: Gary Kang <[email protected]>
  • Loading branch information
skduncan and kangaree authored Sep 11, 2024
1 parent 41c2290 commit 1724150
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion playbook/app/pb_kits/playbook/pb_icon/icon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Icon < Playbook::KitBase
prop :border, type: Playbook::Props::Boolean,
default: false
prop :fixed_width, type: Playbook::Props::Boolean,
default: false
default: true
prop :flip, type: Playbook::Props::Enum,
values: ["horizontal", "vertical", "both", nil],
default: nil
Expand Down
24 changes: 12 additions & 12 deletions playbook/spec/pb_kits/playbook/kits/icon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@
rotation = 90
size = "sm"

expect(subject.new(icon: icon, border: true).classname).to eq "pb_icon_kit far fa-user fa-border"
expect(subject.new(icon: icon, fixed_width: true).classname).to eq "pb_icon_kit far fa-user fa-fw"
expect(subject.new(icon: icon, flip: "horizontal").classname).to eq "pb_icon_kit far fa-user fa-flip-horizontal"
expect(subject.new(icon: icon).classname).to eq "pb_icon_kit far fa-user"
expect(subject.new(icon: icon, inverse: true).classname).to eq "pb_icon_kit far fa-user fa-inverse"
expect(subject.new(icon: icon, list_item: true).classname).to eq "pb_icon_kit far fa-user fa-li"
expect(subject.new(icon: icon, pull: pull).classname).to eq "pb_icon_kit far fa-user fa-pull-#{pull}"
expect(subject.new(icon: icon, pulse: true).classname).to eq "pb_icon_kit far fa-user fa-pulse"
expect(subject.new(icon: icon, rotation: rotation).classname).to eq "pb_icon_kit far fa-user fa-rotate-#{rotation}"
expect(subject.new(icon: icon, size: size).classname).to eq "pb_icon_kit far fa-user fa-#{size}"
expect(subject.new(icon: icon, spin: true).classname).to eq "pb_icon_kit far fa-user fa-spin"
expect(subject.new(icon: icon, classname: "additional_class").classname).to eq "pb_icon_kit far fa-user additional_class"
expect(subject.new(icon: icon, border: true, fixed_width: false).classname).to eq "pb_icon_kit far fa-user fa-border"
expect(subject.new(icon: icon).classname).to eq "pb_icon_kit far fa-user fa-fw"
expect(subject.new(icon: icon, flip: "horizontal").classname).to eq "pb_icon_kit far fa-user fa-fw fa-flip-horizontal"
expect(subject.new(icon: icon).classname).to eq "pb_icon_kit far fa-user fa-fw"
expect(subject.new(icon: icon, inverse: true).classname).to eq "pb_icon_kit far fa-user fa-fw fa-inverse"
expect(subject.new(icon: icon, list_item: true).classname).to eq "pb_icon_kit far fa-user fa-fw fa-li"
expect(subject.new(icon: icon, pull: pull).classname).to eq "pb_icon_kit far fa-user fa-fw fa-pull-#{pull}"
expect(subject.new(icon: icon, pulse: true).classname).to eq "pb_icon_kit far fa-user fa-fw fa-pulse"
expect(subject.new(icon: icon, rotation: rotation).classname).to eq "pb_icon_kit far fa-user fa-fw fa-rotate-#{rotation}"
expect(subject.new(icon: icon, size: size).classname).to eq "pb_icon_kit far fa-user fa-fw fa-#{size}"
expect(subject.new(icon: icon, spin: true).classname).to eq "pb_icon_kit far fa-user fa-fw fa-spin"
expect(subject.new(icon: icon, classname: "additional_class").classname).to eq "pb_icon_kit far fa-user fa-fw additional_class"
end
it "includes color class when color prop is provided", :aggregate_failures do
icon = "user"
Expand Down

0 comments on commit 1724150

Please sign in to comment.