summaryrefslogtreecommitdiffstats
path: root/model/manifest_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/manifest_test.go')
-rw-r--r--model/manifest_test.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/model/manifest_test.go b/model/manifest_test.go
index 46975cf47..1ec43a217 100644
--- a/model/manifest_test.go
+++ b/model/manifest_test.go
@@ -129,3 +129,51 @@ func TestManifestJson(t *testing.T) {
assert.Equal(t, newManifestList, manifestList)
assert.Equal(t, ManifestListToJson(newManifestList), json)
}
+
+func TestManifestHasClient(t *testing.T) {
+ manifest := &Manifest{
+ Id: "theid",
+ Backend: &ManifestBackend{
+ Executable: "theexecutable",
+ },
+ Webapp: &ManifestWebapp{
+ BundlePath: "thebundlepath",
+ },
+ }
+
+ assert.True(t, manifest.HasClient())
+
+ manifest.Webapp = nil
+ assert.False(t, manifest.HasClient())
+}
+
+func TestManifestClientManifest(t *testing.T) {
+ manifest := &Manifest{
+ Id: "theid",
+ Name: "thename",
+ Description: "thedescription",
+ Version: "0.0.1",
+ Backend: &ManifestBackend{
+ Executable: "theexecutable",
+ },
+ Webapp: &ManifestWebapp{
+ BundlePath: "thebundlepath",
+ },
+ }
+
+ sanitized := manifest.ClientManifest()
+
+ assert.NotEmpty(t, sanitized.Id)
+ assert.NotEmpty(t, sanitized.Version)
+ assert.NotEmpty(t, sanitized.Webapp)
+ assert.Empty(t, sanitized.Name)
+ assert.Empty(t, sanitized.Description)
+ assert.Empty(t, sanitized.Backend)
+
+ assert.NotEmpty(t, manifest.Id)
+ assert.NotEmpty(t, manifest.Version)
+ assert.NotEmpty(t, manifest.Webapp)
+ assert.NotEmpty(t, manifest.Name)
+ assert.NotEmpty(t, manifest.Description)
+ assert.NotEmpty(t, manifest.Backend)
+}