Add hardcoded vapid key and a test for it

Hopefully fixes #1569
This commit is contained in:
Pavel Djundik 2017-09-25 11:46:15 +03:00
parent 90ae5dbefc
commit 7c9eedb820
3 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,2 @@
# files that may be generated by tests
.lounge/storage/
.lounge/vapid.json

4
test/fixtures/.lounge/vapid.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"publicKey": "BM0eTDpvDnH7ewlHuXWcPTE1NjlJ06XWIS1cQeBTZmsg4EDx5sOpY7kdX1pniTo8RakL3UdfFuIbC8_zog_BWIM",
"privateKey": "MDEwMjAzMDQwNTA2MDcwODA5MTAxMTEyMTMxNDE1MTY"
}

View File

@ -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();
});