From df345c8b51176d7005cfcd1a92d38f9c7b1d1e5f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Feb 2024 17:12:49 +0800 Subject: [PATCH] bahaghari/tests/lib: add tests for tinted-theming subset --- .../tests/lib/tinted-theming/default.nix | 12 +++++++++++ ...mple-base16-scheme-with-missing-colors.yml | 19 +++++++++++++++++ ...mple-base24-scheme-with-missing-colors.yml | 21 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 subprojects/bahaghari/tests/lib/tinted-theming/sample-base16-scheme-with-missing-colors.yml create mode 100644 subprojects/bahaghari/tests/lib/tinted-theming/sample-base24-scheme-with-missing-colors.yml diff --git a/subprojects/bahaghari/tests/lib/tinted-theming/default.nix b/subprojects/bahaghari/tests/lib/tinted-theming/default.nix index 27d49d52..55bcb08b 100644 --- a/subprojects/bahaghari/tests/lib/tinted-theming/default.nix +++ b/subprojects/bahaghari/tests/lib/tinted-theming/default.nix @@ -2,7 +2,9 @@ let sampleBase16Scheme = lib.trivial.importYAML ./sample-base16-scheme.yml; + sampleBase16Scheme' = lib.trivial.importYAML ./sample-base16-scheme-with-missing-colors.yml; sampleBase24Scheme = lib.trivial.importYAML ./sample-base24-scheme.yml; + sampleBase24Scheme' = lib.trivial.importYAML ./sample-base24-scheme-with-missing-colors.yml; in pkgs.lib.runTests { testIsBase16 = { @@ -10,8 +12,18 @@ pkgs.lib.runTests { expected = true; }; + testIsNotBase16 = { + expr = lib.tinted-theming.isBase16 sampleBase16Scheme'.palette; + expected = false; + }; + testIsBase24 = { expr = lib.tinted-theming.isBase24 sampleBase24Scheme.palette; expected = true; }; + + testIsNotBase24 = { + expr = lib.tinted-theming.isBase24 sampleBase24Scheme'.palette; + expected = false; + }; } diff --git a/subprojects/bahaghari/tests/lib/tinted-theming/sample-base16-scheme-with-missing-colors.yml b/subprojects/bahaghari/tests/lib/tinted-theming/sample-base16-scheme-with-missing-colors.yml new file mode 100644 index 00000000..ccef3ebc --- /dev/null +++ b/subprojects/bahaghari/tests/lib/tinted-theming/sample-base16-scheme-with-missing-colors.yml @@ -0,0 +1,19 @@ +system: "base16" +name: "Bark on a tree" +author: "Gabriel Arazas (https://foodogsquared.one)" +variant: "dark" +description: "Rusty theme resembling forestry inspired from Nord theme." +palette: + base00: "2b221f" + base01: "412c26" + base02: "5c362c" + base03: "a45b43" + base04: "e1bcb2" + base05: "f5ecea" + base06: "fefefe" + base07: "eb8a65" + base08: "d03e68" + base09: "df937a" + base0A: "afa644" + base0E: "8b7ab9" + base0F: "7f3F83" diff --git a/subprojects/bahaghari/tests/lib/tinted-theming/sample-base24-scheme-with-missing-colors.yml b/subprojects/bahaghari/tests/lib/tinted-theming/sample-base24-scheme-with-missing-colors.yml new file mode 100644 index 00000000..82de4719 --- /dev/null +++ b/subprojects/bahaghari/tests/lib/tinted-theming/sample-base24-scheme-with-missing-colors.yml @@ -0,0 +1,21 @@ +system: "base24" +name: "Flat" +author: "FredHappyface (https://github.com/fredHappyface)" +variant: "dark" +palette: + base00: "082845" + base01: "1d2845" + base02: "2e2e45" + base03: "444e5b" + base04: "68717b" + base05: "8c939a" + base06: "b0b6ba" + base07: "e7eced" + base08: "a82320" + base09: "e58d11" + base0A: "3c7dd2" + base0B: "2d9440" + base0C: "2c9370" + base0D: "3167ac" + base0E: "781aa0" + base0F: "541110"