tests: add footer tests

This commit is contained in:
Girish Ramakrishnan
2021-08-31 08:47:01 -07:00
parent 6027397961
commit ffc3c94d77
4 changed files with 67 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
/* global after:false */
const common = require('./common.js'),
constants = require('../../constants.js'),
expect = require('expect.js'),
fs = require('fs'),
paths = require('../../paths.js'),
@@ -166,4 +167,38 @@ describe('Branding API', function () {
expect(response.body.blacklist).to.be(undefined);
});
});
describe('footer', function () {
it('get default succeeds', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/branding/footer`)
.query({ access_token: owner.token });
expect(response.statusCode).to.equal(200);
expect(response.body.footer).to.eql(constants.FOOTER);
});
it('cannot set without data', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/branding/footer`)
.query({ access_token: owner.token })
.ok(() => true);
expect(response.statusCode).to.equal(400);
});
it('set succeeds', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/branding/footer`)
.query({ access_token: owner.token })
.send({ footer: 'BigFoot Inc' });
expect(response.statusCode).to.equal(200);
});
it('get succeeds', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/branding/footer`)
.query({ access_token: owner.token });
expect(response.statusCode).to.equal(200);
expect(response.body.footer).to.eql('BigFoot Inc');
});
});
});