Add tests for new theme helper functionality

This commit is contained in:
Andreas Nedbal 2023-01-12 18:31:26 +01:00 committed by Andreas Nedbal
parent 07a13d39da
commit 527f3fc3f5
1 changed files with 18 additions and 0 deletions

View File

@ -242,4 +242,22 @@ describe ThemeHelper, :type => :helper do
end end
end end
end end
describe "#get_color_for_key" do
context "any key and value are supplied" do
subject { helper.get_color_for_key("primary", 6174129) }
it "returns a hex color code" do
expect(subject).to eq("#5e35b1")
end
end
context "a text key is supplied" do
subject { helper.get_color_for_key("primary-text", 6174129) }
it "returns RGB triplets" do
expect(subject).to eq("94, 53, 177")
end
end
end
end end