-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firefox: organize tests by submodule
- Loading branch information
1 parent
437ec62
commit 681e848
Showing
15 changed files
with
285 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
let name = "firefox"; | ||
|
||
in builtins.mapAttrs (test: module: import module [ "programs" name ]) { | ||
"${name}-profile-settings" = ./profile-settings.nix; | ||
"${name}-state-version-19_09" = ./state-version-19_09.nix; | ||
"${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; | ||
"${name}-duplicate-profile-ids" = ./duplicate-profile-ids.nix; | ||
"${name}-duplicate-container-ids" = ./duplicate-container-ids.nix; | ||
"${name}-container-id-out-of-range" = ./container-id-out-of-range.nix; | ||
"${name}-policies" = ./policies.nix; | ||
"${name}-profiles-bookmarks" = ./profiles/bookmarks; | ||
"${name}-profiles-containers" = ./profiles/containers; | ||
"${name}-profiles-containers-duplicate-ids" = | ||
./profiles/containers/duplicate-ids.nix; | ||
"${name}-profiles-containers-id-out-of-range" = | ||
./profiles/containers/id-out-of-range.nix; | ||
"${name}-profiles-duplicate-ids" = ./profiles/duplicate-ids.nix; | ||
"${name}-profiles-search" = ./profiles/search; | ||
"${name}-profiles-settings" = ./profiles/settings; | ||
"${name}-state-version-19_09" = ./state-version-19_09.nix; | ||
} |
This file was deleted.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
tests/modules/programs/firefox/profiles/bookmarks/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
modulePath: | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
|
||
cfg = getAttrFromPath modulePath config; | ||
|
||
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; | ||
|
||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig (setAttrByPath modulePath { | ||
enable = true; | ||
profiles.bookmarks = { | ||
settings = { "general.smoothScroll" = false; }; | ||
bookmarks = [ | ||
{ | ||
toolbar = true; | ||
bookmarks = [{ | ||
name = "Home Manager"; | ||
url = "https://wiki.nixos.org/wiki/Home_Manager"; | ||
}]; | ||
} | ||
{ | ||
name = "wikipedia"; | ||
tags = [ "wiki" ]; | ||
keyword = "wiki"; | ||
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; | ||
} | ||
{ | ||
name = "kernel.org"; | ||
url = "https://www.kernel.org"; | ||
} | ||
{ | ||
name = "Nix sites"; | ||
bookmarks = [ | ||
{ | ||
name = "homepage"; | ||
url = "https://nixos.org/"; | ||
} | ||
{ | ||
name = "wiki"; | ||
tags = [ "wiki" "nix" ]; | ||
url = "https://wiki.nixos.org/"; | ||
} | ||
{ | ||
name = "Nix sites"; | ||
bookmarks = [ | ||
{ | ||
name = "homepage"; | ||
url = "https://nixos.org/"; | ||
} | ||
{ | ||
name = "wiki"; | ||
url = "https://wiki.nixos.org/"; | ||
} | ||
]; | ||
} | ||
]; | ||
} | ||
]; | ||
}; | ||
} // { | ||
nmt.script = '' | ||
bookmarksUserJs=$(normalizeStorePaths \ | ||
home-files/${cfg.configPath}/bookmarks/user.js) | ||
assertFileContent \ | ||
$bookmarksUserJs \ | ||
${./expected-bookmarks-user.js} | ||
bookmarksFile="$(sed -n \ | ||
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ | ||
$TESTED/home-files/${cfg.configPath}/bookmarks/user.js)" | ||
assertFileContent \ | ||
$bookmarksFile \ | ||
${./expected-bookmarks.html} | ||
''; | ||
}); | ||
} |
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
tests/modules/programs/firefox/profiles/containers/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
modulePath: | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
|
||
cfg = getAttrFromPath modulePath config; | ||
|
||
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; | ||
|
||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig (setAttrByPath modulePath { | ||
enable = true; | ||
profiles.containers = { | ||
containers = { | ||
"shopping" = { | ||
icon = "circle"; | ||
color = "yellow"; | ||
}; | ||
}; | ||
}; | ||
} // { | ||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/${cfg.configPath}/containers/containers.json \ | ||
${./expected-containers.json} | ||
''; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...profile-settings-expected-containers.json → ...files/containers/expected-containers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":6},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":6,"version":4} | ||
{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":0},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":0,"version":4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.