mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-22 12:33:11 -04:00
chore(frontend): harden settings parsing and update store imports
This commit is contained in:
@@ -30,6 +30,16 @@ describe('utils/settings', () => {
|
||||
expect(res.tags).toStrictEqual({ enabled: true, title: 'My Tags' });
|
||||
});
|
||||
|
||||
test('Should ignore non-string title values and keep defaults', () => {
|
||||
const res = taxonomiesConfig({
|
||||
tags: { title: null as any },
|
||||
categories: { title: 123 as any },
|
||||
});
|
||||
|
||||
expect(res.tags).toStrictEqual({ enabled: true, title: 'Tags' });
|
||||
expect(res.categories).toStrictEqual({ enabled: true, title: 'Categories' });
|
||||
});
|
||||
|
||||
test('Should ignore unknown taxonomy keys', () => {
|
||||
const input = {
|
||||
unknownKey: { enabled: true, title: 'X' },
|
||||
|
||||
Reference in New Issue
Block a user