From 7c9eedb8208b63c38158d2381aa989b783dca996 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 25 Sep 2017 11:46:15 +0300 Subject: [PATCH] Add hardcoded vapid key and a test for it Hopefully fixes #1569 --- test/fixtures/.gitignore | 1 - test/fixtures/.lounge/vapid.json | 4 ++++ test/server.js | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/.lounge/vapid.json diff --git a/test/fixtures/.gitignore b/test/fixtures/.gitignore index f58e9cac..5708c99e 100644 --- a/test/fixtures/.gitignore +++ b/test/fixtures/.gitignore @@ -1,3 +1,2 @@ # files that may be generated by tests .lounge/storage/ -.lounge/vapid.json diff --git a/test/fixtures/.lounge/vapid.json b/test/fixtures/.lounge/vapid.json new file mode 100644 index 00000000..60bc7598 --- /dev/null +++ b/test/fixtures/.lounge/vapid.json @@ -0,0 +1,4 @@ +{ + "publicKey": "BM0eTDpvDnH7ewlHuXWcPTE1NjlJ06XWIS1cQeBTZmsg4EDx5sOpY7kdX1pniTo8RakL3UdfFuIbC8_zog_BWIM", + "privateKey": "MDEwMjAzMDQwNTA2MDcwODA5MTAxMTEyMTMxNDE1MTY" +} diff --git a/test/server.js b/test/server.js index 77c74922..ec2a31a8 100644 --- a/test/server.js +++ b/test/server.js @@ -97,6 +97,10 @@ describe("Server", () => { expect(data.networks).to.be.an("array"); expect(data.networks).to.be.empty; expect(data.token).to.be.null; + expect(data.pushSubscription).to.be.undefined; + + // Private key defined in vapid.json is "01020304050607080910111213141516" for this public key. + expect(data.applicationServerKey).to.equal("BM0eTDpvDnH7ewlHuXWcPTE1NjlJ06XWIS1cQeBTZmsg4EDx5sOpY7kdX1pniTo8RakL3UdfFuIbC8_zog_BWIM"); done(); });