Card refinements

This commit is contained in:
2026-08-11 15:58:15 -04:00
parent 793dfab5c8
commit 721828b5cb
9 changed files with 134 additions and 38 deletions

View File

@@ -202,3 +202,27 @@ describe('chips and tooltips', () => {
.toEqual([])
})
})
describe('stacked rows', () => {
const card = {
render: 'list',
layout: 'stacked',
map: { title: 'typename', detail: 'message', detailtooltip: 'fullmessage' },
_data: [{ typename: 'Recertification', message: 'Short text', fullmessage: 'Short text' }],
}
it('offers no tooltip when the detail is already whole', () => {
// A tooltip repeating what is on screen is noise, and it makes the cursor
// change for no reason.
expect(cardRows(card)[0].detailtip).toBe('')
})
it('offers the full text when the detail was trimmed', () => {
const trimmed = { ...card, _data: [{
typename: 'General', message: 'Start of a long message...',
fullmessage: 'Start of a long message that continues well past the card',
}] }
expect(cardRows(trimmed)[0].detailtip)
.toBe('Start of a long message that continues well past the card')
})
})