Merge pull request #1572 from thelounge/xpaw/add-vapid-test

Add hardcoded vapid key and a test for it
This commit is contained in:
Pavel Djundik 2017-09-25 23:12:02 +03:00 committed by GitHub
commit 80ef01c180
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();
});