Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: added tests for loading flavors #7

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions test/catppuccin_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,46 @@ defmodule CatppuccinTest do
doctest Catppuccin.Color
doctest Catppuccin.Flavor
doctest Catppuccin.FlavorETS

setup do
{:latte, latte} = Catppuccin.latte()
{:frappe, frappe} = Catppuccin.frappe()
{:macchiato, macchiato} = Catppuccin.macchiato()
{:mocha, mocha} = Catppuccin.mocha()

latte_colors = latte |> Map.get(:colors)
frappe_colors = frappe |> Map.get(:colors)
macchiato_colors = macchiato |> Map.get(:colors)
mocha_colors = mocha |> Map.get(:colors)

{
:ok,
latte_colors: latte_colors,
frappe_colors: frappe_colors,
macchiato_colors: macchiato_colors,
mocha_colors: mocha_colors
}
end

test "Flavors have the same number of colors defined", %{
latte_colors: latte_colors,
frappe_colors: frappe_colors,
macchiato_colors: macchiato_colors,
mocha_colors: mocha_colors
} do
assert Kernel.map_size(latte_colors) == Kernel.map_size(frappe_colors)
assert Kernel.map_size(latte_colors) == Kernel.map_size(macchiato_colors)
assert Kernel.map_size(latte_colors) == Kernel.map_size(mocha_colors)
end

test "Each flavor has a unique set of colors", %{
latte_colors: latte_colors,
frappe_colors: frappe_colors,
macchiato_colors: macchiato_colors,
mocha_colors: mocha_colors
} do
assert latte_colors != frappe_colors
assert latte_colors != macchiato_colors
assert latte_colors != mocha_colors
end
end
Loading