summaryrefslogtreecommitdiffstats
path: root/model/manifest_test.go
diff options
context:
space:
mode:
authorJesse Hallam <jesse.hallam@gmail.com>2018-07-31 16:29:52 -0400
committerGitHub <noreply@github.com>2018-07-31 16:29:52 -0400
commit0788cdcadfb5d76b08758f42f01521b45ea76362 (patch)
tree86efb424a0543571398866e3cb84ee38be101141 /model/manifest_test.go
parent8c56f52d17d73a431a060919c97fe8939f81a0d1 (diff)
downloadchat-0788cdcadfb5d76b08758f42f01521b45ea76362.tar.gz
chat-0788cdcadfb5d76b08758f42f01521b45ea76362.tar.bz2
chat-0788cdcadfb5d76b08758f42f01521b45ea76362.zip
MM-11420: plugins: compute bundle hash on load (#9172)
* plugins: compute bundle hash on load Use this hash to bust client caches whenever the plugin bundle changes. * eliminate redundant pluginHandler * switch to 64-bit FNV-1a * Fix test
Diffstat (limited to 'model/manifest_test.go')
-rw-r--r--model/manifest_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/model/manifest_test.go b/model/manifest_test.go
index c6b31e5df..80d22a3ad 100644
--- a/model/manifest_test.go
+++ b/model/manifest_test.go
@@ -255,6 +255,7 @@ func TestManifestClientManifest(t *testing.T) {
},
Webapp: &ManifestWebapp{
BundlePath: "thebundlepath",
+ BundleHash: []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
},
SettingsSchema: &PluginSettingsSchema{
Header: "theheadertext",
@@ -281,10 +282,11 @@ func TestManifestClientManifest(t *testing.T) {
sanitized := manifest.ClientManifest()
- assert.NotEmpty(t, sanitized.Id)
- assert.NotEmpty(t, sanitized.Version)
- assert.NotEmpty(t, sanitized.Webapp)
- assert.NotEmpty(t, sanitized.SettingsSchema)
+ assert.Equal(t, manifest.Id, sanitized.Id)
+ assert.Equal(t, manifest.Version, sanitized.Version)
+ assert.Equal(t, "/static/theid/theid_000102030405060708090a0b0c0d0e0f_bundle.js", sanitized.Webapp.BundlePath)
+ assert.Equal(t, manifest.Webapp.BundleHash, sanitized.Webapp.BundleHash)
+ assert.Equal(t, manifest.SettingsSchema, sanitized.SettingsSchema)
assert.Empty(t, sanitized.Name)
assert.Empty(t, sanitized.Description)
assert.Empty(t, sanitized.Server)