mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
tests/discoss: add tests
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
6e8ab005bc
commit
3c3076b1c1
5 changed files with 99 additions and 0 deletions
34
tests/modules/programs/discocss/basic-configuration.nix
Normal file
34
tests/modules/programs/discocss/basic-configuration.nix
Normal file
|
|
@ -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}
|
||||
'';
|
||||
};
|
||||
}
|
||||
5
tests/modules/programs/discocss/default.nix
Normal file
5
tests/modules/programs/discocss/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
discocss-basic-configuration = ./basic-configuration.nix;
|
||||
discocss-no-packages = ./no-packages.nix;
|
||||
discocss-no-css = ./no-css.nix;
|
||||
}
|
||||
12
tests/modules/programs/discocss/no-css.nix
Normal file
12
tests/modules/programs/discocss/no-css.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config = {
|
||||
programs.discocss = {
|
||||
enable = true;
|
||||
discordAlias = false;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/discocss/custom.css
|
||||
'';
|
||||
};
|
||||
}
|
||||
34
tests/modules/programs/discocss/no-packages.nix
Normal file
34
tests/modules/programs/discocss/no-packages.nix
Normal file
|
|
@ -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}
|
||||
'';
|
||||
};
|
||||
}
|
||||
14
tests/modules/programs/discocss/with-custom-css-expected.css
Normal file
14
tests/modules/programs/discocss/with-custom-css-expected.css
Normal file
|
|
@ -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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue