Card refinements
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user