mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
27 lines
877 B
TypeScript
27 lines
877 B
TypeScript
import { assertEquals } from '@std/assert';
|
|
|
|
import data from '~/fixtures/config-db.json' with { type: 'json' };
|
|
|
|
import { PleromaConfig } from '@/schemas/pleroma-api.ts';
|
|
import { PleromaConfigDB } from './PleromaConfigDB.ts';
|
|
|
|
Deno.test('PleromaConfigDB.getIn', () => {
|
|
const configDB = new PleromaConfigDB(data.configs as PleromaConfig[]);
|
|
|
|
assertEquals(
|
|
configDB.get(':pleroma', ':frontend_configurations')?.value,
|
|
configDB.getIn(':pleroma', ':frontend_configurations'),
|
|
);
|
|
|
|
assertEquals(configDB.getIn(':pleroma', ':frontend_configurations', ':bleroma'), undefined);
|
|
|
|
assertEquals(
|
|
configDB.getIn(':pleroma', ':frontend_configurations', ':soapbox_fe', 'colors', 'primary', '500'),
|
|
'#1ca82b',
|
|
);
|
|
|
|
assertEquals(
|
|
configDB.getIn(':pleroma', ':frontend_configurations', ':soapbox_fe', 'colors', 'primary', '99999999'),
|
|
undefined,
|
|
);
|
|
});
|