fix: A1-9 replace native color input with 17-preset colour picker popover + custom hex
This commit is contained in:
@@ -241,7 +241,8 @@ defmodule BDS.Desktop.ShellLiveTest do
|
||||
edit_draft: %{"name" => "news", "color" => "#3b82f6", "post_template_slug" => ""},
|
||||
selected: ["news", "updates"],
|
||||
merge_target: "news",
|
||||
templates: [%{slug: "post-template", title: "Post Template"}]
|
||||
templates: [%{slug: "post-template", title: "Post Template"}],
|
||||
colour_presets: BDS.Desktop.ShellLive.TagsEditor.colour_presets()
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
@@ -229,6 +229,13 @@ defmodule BDS.TagsTest do
|
||||
] = Jason.decode!(File.read!(tags_path))
|
||||
end
|
||||
|
||||
test "colour_presets contains exactly 17 unique valid hex colours" do
|
||||
presets = BDS.Desktop.ShellLive.TagsEditor.colour_presets()
|
||||
assert length(presets) == 17
|
||||
assert length(Enum.uniq(presets)) == 17
|
||||
assert Enum.all?(presets, &Regex.match?(~r/^#[0-9a-fA-F]{6}$/, &1))
|
||||
end
|
||||
|
||||
defp errors_on(changeset) do
|
||||
Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
|
||||
Regex.replace(~r"%{(\w+)}", message, fn _, key ->
|
||||
|
||||
Reference in New Issue
Block a user