parent
e1a86d4e1c
commit
48d0572403
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@
|
||||
import { ConfigDB } from '../config_db';
|
||||
import config_db from 'soapbox/__fixtures__/config_db.json';
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
test('find', () => {
|
||||
const configs = fromJS(config_db).get('configs');
|
||||
expect(ConfigDB.find(configs, ':phoenix', ':json_library')).toEqual(fromJS({
|
||||
group: ':phoenix',
|
||||
key: ':json_library',
|
||||
value: 'Jason',
|
||||
}));
|
||||
});
|
@ -0,0 +1,9 @@
|
||||
export const ConfigDB = {
|
||||
find: (configs, group, key) => {
|
||||
return configs.find(config =>
|
||||
config.isSuperset({ group, key })
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default ConfigDB;
|
Loading…
Reference in new issue