Polish clipboard history display
This commit is contained in:
@@ -19,6 +19,12 @@ assertDeepEqual(
|
||||
'clipboard normalizes image entries with default mime'
|
||||
)
|
||||
|
||||
assertDeepEqual(
|
||||
clipboard.normalizeEntry({ type: 'image', path: '/tmp/a.png', mime: 'image/png', capturedAt: 'Friday 14:42' }),
|
||||
{ type: 'image', path: '/tmp/a.png', mime: 'image/png', capturedAt: 'Friday 14:42' },
|
||||
'clipboard keeps image capture timestamps'
|
||||
)
|
||||
|
||||
assertDeepEqual(
|
||||
clipboard.parseHistory(JSON.stringify(['one', '', { type: 'text', text: 'two' }, { type: 'image', path: '/tmp/a.jpg', mime: 'image/jpeg' }])),
|
||||
[
|
||||
@@ -65,6 +71,18 @@ assertDeepEqual(
|
||||
'clipboard display rows search image metadata'
|
||||
)
|
||||
|
||||
assertDeepEqual(
|
||||
clipboard.displayRows([{ type: 'image', path: '/tmp/a.png', mime: 'image/png', capturedAt: 'Friday 14:42' }], '', 50)[0].previewText,
|
||||
'Screenshot Friday 14:42',
|
||||
'clipboard labels timestamped png image entries as screenshots'
|
||||
)
|
||||
|
||||
assertDeepEqual(
|
||||
clipboard.displayRows([{ type: 'image', path: '/tmp/a.jpg', mime: 'image/jpeg', capturedAt: 'Friday 14:42' }], '', 50)[0].previewText,
|
||||
'Image Friday 14:42',
|
||||
'clipboard labels timestamped non-png image entries as images'
|
||||
)
|
||||
|
||||
assertDeepEqual(
|
||||
clipboard.displayRows(history, 'image', 50).map(row => row.index),
|
||||
[2],
|
||||
|
||||
Reference in New Issue
Block a user