fix: check brand:touchIcon for correct path

This commit is contained in:
Barış Soner Uşaklı
2025-09-12 19:19:52 -04:00
parent f9ddbebacc
commit 56fad0be0d
2 changed files with 21 additions and 5 deletions

View File

@@ -6,8 +6,8 @@ const fs = require('fs');
const path = require('path');
const util = require('util');
const request = require('../src/request');
const db = require('./mocks/databasemock');
const request = require('../src/request');
const api = require('../src/api');
const categories = require('../src/categories');
const topics = require('../src/topics');
@@ -692,6 +692,16 @@ describe('Controllers', () => {
assert(body);
});
it('should 404 if brand:touchIcon is not valid', async () => {
const oldValue = meta.config['brand:touchIcon'];
meta.config['brand:touchIcon'] = '../../not/valid';
const { response, body } = await request.get(`${nconf.get('url')}/apple-touch-icon`);
assert.strictEqual(response.statusCode, 404);
assert.strictEqual(body, 'Not found');
meta.config['brand:touchIcon'] = oldValue;
})
it('should error if guests do not have search privilege', async () => {
const { response, body } = await request.get(`${nconf.get('url')}/api/users?query=bar&section=sort-posts`);