tests/modules/home-manager: init programs.pop-launcher

This commit is contained in:
Gabriel Arazas 2024-03-06 20:23:05 +08:00
parent 9577f5a4f7
commit a65a0a3982
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 52 additions and 0 deletions

View File

@ -52,5 +52,6 @@ import nmt {
testedAttrPath = [ "home" "activationPackage" ]; testedAttrPath = [ "home" "activationPackage" ];
tests = builtins.foldl' (a: b: a // (import b)) { } [ tests = builtins.foldl' (a: b: a // (import b)) { } [
./programs/neovide ./programs/neovide
./programs/pop-launcher
]; ];
} }

View File

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
programs.pop-launcher = {
enable = true;
plugins = with pkgs; [
pop-launcher-plugin-duckduckgo-bangs
pop-launcher-plugin-brightness
];
};
test.stubs = {
pop-launcher = { };
pop-launcher-plugin-duckduckgo-bangs = {
outPath = null;
buildScript = ''
mkdir -p $out/share/pop-launcher/{scripts,plugins/bangs}
echo "hello" | tee "$out/share/pop-launcher/plugins/bangs/bangs"
echo "WHOA" | tee "$out/share/pop-launcher/scripts/whoa"
'';
};
pop-launcher-plugin-brightness = {
outPath = null;
buildScript = ''
mkdir -p "$out/share/pop-launcher/plugins/brightness"
echo "world" | tee "$out/share/pop-launcher/plugins/brightness/brightness"
'';
};
};
nmt.script = ''
assertFileExists home-files/.local/share/pop-launcher/plugins/bangs/bangs
assertFileExists home-files/.local/share/pop-launcher/scripts/whoa
assertFileExists home-files/.local/share/pop-launcher/plugins/brightness/brightness
'';
}

View File

@ -0,0 +1,4 @@
{
pop-launcher-basic = ./basic.nix;
pop-launcher-empty = ./empty.nix;
}

View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
programs.pop-launcher.enable = true;
test.stubs.pop-launcher = { };
nmt.script = ''
assertDirectoryEmpty home-files/.local/share/pop-launcher
'';
}