Skip to content

Commit

Permalink
[PLAY-235] BUGFIX - Classnames and global props in the list kit for r…
Browse files Browse the repository at this point in the history
…ails (#1981)

* Fix not generating classnames in list kit

* Fix tests not expecting dark class

Co-authored-by: Jasper Furniss <jasper.furniss@powerhrg.com>
  • Loading branch information
augustomallmann and jasperfurniss committed Aug 5, 2022
1 parent d34a22a commit 00c5b89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions playbook/app/pb_kits/playbook/pb_list/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ class List < Playbook::KitBase
prop :tabindex

def list_classname
[
"pb_list_kit",
xpadding_class,
borderless_class,
dark_class,
size_class,
layout_class,
].compact.join("_")
generate_classname("pb_list_kit",
xpadding_class,
borderless_class,
dark_class,
size_class,
layout_class)
end

def ordered_class
Expand Down
4 changes: 2 additions & 2 deletions playbook/spec/pb_kits/playbook/kits/list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
describe "#classname" do
it "returns namespaced class name", :aggregate_failures do
expect(subject.new({}).list_classname).to eq "pb_list_kit_"
expect(subject.new(dark: true).list_classname).to eq "pb_list_kit_dark_"
expect(subject.new(dark: true).list_classname).to eq "pb_list_kit_dark_ dark"
expect(subject.new(borderless: true).list_classname).to eq "pb_list_kit_borderless_"
expect(subject.new(xpadding: true).list_classname).to eq "pb_list_kit_xpadding_"
expect(subject.new(size: "large").list_classname).to eq "pb_list_kit_large_"
expect(subject.new(layout: "right").list_classname).to eq "pb_list_kit_layout_right"
expect(subject.new(dark: true, xpadding: true, size: "large", borderless: true, layout: "left").list_classname).to eq "pb_list_kit_xpadding_borderless_dark_large_layout_left"
expect(subject.new(dark: true, xpadding: true, size: "large", borderless: true, layout: "left").list_classname).to eq "pb_list_kit_xpadding_borderless_dark_large_layout_left dark"
end
end
end

0 comments on commit 00c5b89

Please sign in to comment.