Skip to content

Commit

Permalink
test assetlinks.json validation
Browse files Browse the repository at this point in the history
  • Loading branch information
m5r committed Apr 25, 2024
1 parent 8ed362c commit 542a32a
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"locale": "en",
"locales": [
{
"code": "en",
"name": "English"
},
{
"code": "es",
"name": "Español (Spanish)"
}
],
"kujua-reporting": [
{
"code": "SS",
"reporting_freq": "monthly"
}
],
"assetlinks": [
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "org.medicmobile.webapp.mobile",
"sha256_cert_fingerprints": [
"62:BF:C1:78:24:D8:4D:5C:B4:E1:8B:66:98:EA:14:16:57:6F:A4:E5:96:CD:93:81:B2:65:19:71:A7:80:EA:4D"
]
}
},
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "org.medicmobile.something.else",
"sha256_cert_fingerprints": [
"asdf",
"zxcvbn"
]
}
}
],
"contact_summary": "",
"tasks": {
"rules": "",
"targets": {}
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "org.medicmobile.webapp.mobile"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"locale": "en",
"locales": [
{
"code": "en",
"name": "English"
},
{
"code": "es",
"name": "Español (Spanish)"
}
],
"kujua-reporting": [
{
"code": "SS",
"reporting_freq": "monthly"
}
]
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "org.medicmobile.webapp.mobile",
"sha256_cert_fingerprints": [
"62:BF:C1:78:24:D8:4D:5C:B4:E1:8B:66:98:EA:14:16:57:6F:A4:E5:96:CD:93:81:B2:65:19:71:A7:80:EA:4D"
]
}
},
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "org.medicmobile.something.else",
"sha256_cert_fingerprints": [
"asdf",
"zxcvbn"
]
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"locale": "en",
"locales": [
{
"code": "en",
"name": "English"
},
{
"code": "es",
"name": "Español (Spanish)"
}
],
"kujua-reporting": [
{
"code": "SS",
"reporting_freq": "monthly"
}
]
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 11 additions & 2 deletions test/fn/compile-app-settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const scenarios = [
folder: 'purge/no-export-purge/project',
},
{
description: 'should handle a project with eslint error when --debug flag is present',
description: 'should handle a project with eslint error when --debug flag is present',
folder: 'eslint-error/project',
extraArgs: ['--debug'],
},
Expand All @@ -58,11 +58,15 @@ const scenarios = [
{
description: 'should handle a configuration using the base_settings file',
folder: 'base-settings/project',
},
},
{
description: 'should handle a configuration using the forms.json and schedules.json files',
folder: 'sms-modules/project',
},
{
description: 'should handle a configuration using the assetlinks.json file',
folder: 'android-app-links/project',
},

// REJECTION SCENARIOS
{
Expand Down Expand Up @@ -115,6 +119,11 @@ const scenarios = [
folder: 'missing-eslintrc/project',
error: 'No eslint configuration',
},
{
description: 'should reject a configuration using an invalid assetlinks.json file',
folder: 'android-app-links/invalid-file',
error: 'Invalid assetlinks: ValidationError: "[0].target.sha256_cert_fingerprints" is required',
},
];

describe('compile-app-settings', () => {
Expand Down

0 comments on commit 542a32a

Please sign in to comment.