mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
32 lines
466 B
TypeScript
32 lines
466 B
TypeScript
|
import { objectValueFromPath } from './object';
|
||
|
|
||
|
describe('object', () => {
|
||
|
|
||
|
test.each([
|
||
|
[
|
||
|
{
|
||
|
note: {
|
||
|
id: '123',
|
||
|
title: 'my note',
|
||
|
},
|
||
|
},
|
||
|
'note.title',
|
||
|
'my note',
|
||
|
],
|
||
|
[
|
||
|
{
|
||
|
note: {
|
||
|
id: '123',
|
||
|
title: 'my note',
|
||
|
},
|
||
|
},
|
||
|
'note.doesntexist',
|
||
|
undefined,
|
||
|
],
|
||
|
])('should extract URLs', (object, path, expected) => {
|
||
|
const actual = objectValueFromPath(object, path);
|
||
|
expect(actual).toBe(expected);
|
||
|
});
|
||
|
|
||
|
});
|