diff --git a/tests/modules/programs/discocss/basic-configuration.nix b/tests/modules/programs/discocss/basic-configuration.nix new file mode 100644 index 000000000..92a30e81a --- /dev/null +++ b/tests/modules/programs/discocss/basic-configuration.nix @@ -0,0 +1,34 @@ +{ + config = { + programs.discocss = { + enable = true; + package = null; + + discordAlias = false; + + css = '' + /* Custom Discord theme */ + .theme-dark { + --background-primary: #2f3136; + --background-secondary: #36393f; + } + + .chat-3bRxxu { + background: var(--background-primary); + } + + .content-yTz4x3:before { + content: "Custom CSS Loaded"; + color: #43b581; + } + ''; + }; + + nmt.script = '' + assertFileExists home-files/.config/discocss/custom.css + assertFileContent \ + home-files/.config/discocss/custom.css \ + ${./with-custom-css-expected.css} + ''; + }; +} diff --git a/tests/modules/programs/discocss/default.nix b/tests/modules/programs/discocss/default.nix new file mode 100644 index 000000000..f6fe3bee5 --- /dev/null +++ b/tests/modules/programs/discocss/default.nix @@ -0,0 +1,5 @@ +{ + discocss-basic-configuration = ./basic-configuration.nix; + discocss-no-packages = ./no-packages.nix; + discocss-no-css = ./no-css.nix; +} diff --git a/tests/modules/programs/discocss/no-css.nix b/tests/modules/programs/discocss/no-css.nix new file mode 100644 index 000000000..a5a753ad9 --- /dev/null +++ b/tests/modules/programs/discocss/no-css.nix @@ -0,0 +1,12 @@ +{ + config = { + programs.discocss = { + enable = true; + discordAlias = false; + }; + + nmt.script = '' + assertPathNotExists home-files/.config/discocss/custom.css + ''; + }; +} diff --git a/tests/modules/programs/discocss/no-packages.nix b/tests/modules/programs/discocss/no-packages.nix new file mode 100644 index 000000000..62c1d1077 --- /dev/null +++ b/tests/modules/programs/discocss/no-packages.nix @@ -0,0 +1,34 @@ +{ + config = { + programs.discocss = { + enable = true; + package = null; + discordPackage = null; + discordAlias = false; + + css = '' + /* Custom Discord theme */ + .theme-dark { + --background-primary: #2f3136; + --background-secondary: #36393f; + } + + .chat-3bRxxu { + background: var(--background-primary); + } + + .content-yTz4x3:before { + content: "Custom CSS Loaded"; + color: #43b581; + } + ''; + }; + + nmt.script = '' + assertFileExists home-files/.config/discocss/custom.css + assertFileContent \ + home-files/.config/discocss/custom.css \ + ${./with-custom-css-expected.css} + ''; + }; +} diff --git a/tests/modules/programs/discocss/with-custom-css-expected.css b/tests/modules/programs/discocss/with-custom-css-expected.css new file mode 100644 index 000000000..6f1f0d5e8 --- /dev/null +++ b/tests/modules/programs/discocss/with-custom-css-expected.css @@ -0,0 +1,14 @@ +/* Custom Discord theme */ +.theme-dark { + --background-primary: #2f3136; + --background-secondary: #36393f; +} + +.chat-3bRxxu { + background: var(--background-primary); +} + +.content-yTz4x3:before { + content: "Custom CSS Loaded"; + color: #43b581; +}