firefoxpwa: add module (#7408)
Adds the `firefoxpwa` module for the native Progressive Web Apps for Firefox application.
This commit is contained in:
parent
5751fa774f
commit
218da00bfa
5 changed files with 309 additions and 0 deletions
33
tests/modules/programs/firefoxpwa/assertions.nix
Normal file
33
tests/modules/programs/firefoxpwa/assertions.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
programs.firefoxpwa = {
|
||||
enable = true;
|
||||
package = null;
|
||||
profiles = {
|
||||
"INVALID" = { };
|
||||
"0123456789ABCDEFGHJKMNPQRS".sites."00000000000000000000000000" = {
|
||||
name = "MDN Web Docs";
|
||||
url = "https://developer.mozilla.org/";
|
||||
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
|
||||
};
|
||||
"ZYXWVTSRQPNMKJHGFEDCBA9876".sites."00000000000000000000000000" = {
|
||||
name = "MDN Web Docs";
|
||||
url = "https://developer.mozilla.org/";
|
||||
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
|
||||
};
|
||||
};
|
||||
};
|
||||
test.asserts.assertions.expected = [
|
||||
''
|
||||
ULID 'INVALID' at 'programs.firefoxpwa.profiles' must be 26 characters, but is
|
||||
7 characters long.
|
||||
''
|
||||
''
|
||||
ULID 'INVALID' at 'programs.firefoxpwa.profiles' must only contain characters
|
||||
'0123456789ABCDEFGHJKMNPQRSTVWXYZ', but contains 'ILI'.
|
||||
''
|
||||
''
|
||||
Site with ULID '00000000000000000000000000' must be present in exactly one profile, but is present
|
||||
in 2 profiles, namely '0123456789ABCDEFGHJKMNPQRS', 'ZYXWVTSRQPNMKJHGFEDCBA9876'.
|
||||
''
|
||||
];
|
||||
}
|
||||
1
tests/modules/programs/firefoxpwa/config-expected.json
Normal file
1
tests/modules/programs/firefoxpwa/config-expected.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"profiles":{"0123456789ABCDEFGHJKMNPQRS":{"name":"0123456789ABCDEFGHJKMNPQRS","sites":["ZYXWVTSRQPNMKJHGFEDCBA9876"],"ulid":"0123456789ABCDEFGHJKMNPQRS"}},"sites":{"ZYXWVTSRQPNMKJHGFEDCBA9876":{"config":{"document_url":"https://developer.mozilla.org/","manifest_url":"https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json","name":"MDN Web Docs"},"manifest":{"name":"MDN Web Docs","start_url":"https://developer.mozilla.org/"},"profile":"0123456789ABCDEFGHJKMNPQRS","ulid":"ZYXWVTSRQPNMKJHGFEDCBA9876"}}}
|
||||
17
tests/modules/programs/firefoxpwa/config.nix
Normal file
17
tests/modules/programs/firefoxpwa/config.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
programs.firefoxpwa = {
|
||||
enable = true;
|
||||
package = null;
|
||||
profiles."0123456789ABCDEFGHJKMNPQRS".sites."ZYXWVTSRQPNMKJHGFEDCBA9876" = {
|
||||
name = "MDN Web Docs";
|
||||
url = "https://developer.mozilla.org/";
|
||||
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
configFile=home-files/.local/share/firefoxpwa/config.json
|
||||
assertFileExists $configFile
|
||||
assertFileContent $configFile ${./config-expected.json}
|
||||
'';
|
||||
}
|
||||
4
tests/modules/programs/firefoxpwa/default.nix
Normal file
4
tests/modules/programs/firefoxpwa/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
firefoxpwa-config = ./config.nix;
|
||||
firefoxpwa-assertions = ./assertions.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue