mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +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);
|
||
|
});
|
||
|
|
||
|
});
|