mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-23 02:20:01 +01:00
Display comments in SongDetails and AlbumList's details
This commit is contained in:
parent
98af68ac99
commit
5111cf8c33
5 changed files with 97 additions and 0 deletions
30
ui/src/common/MultiLineTextField.test.js
Normal file
30
ui/src/common/MultiLineTextField.test.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import * as React from 'react'
|
||||
import { render, cleanup, screen } from '@testing-library/react'
|
||||
import MultiLineTextField from './MultiLineTextField'
|
||||
|
||||
describe('<MultiLineTextField />', () => {
|
||||
afterEach(cleanup)
|
||||
|
||||
it('should render each line in a separated div', () => {
|
||||
const record = { comment: 'line1\nline2' }
|
||||
const { queryByTestId } = render(
|
||||
<MultiLineTextField record={record} source={'comment'} />
|
||||
)
|
||||
expect(queryByTestId('comment.0').textContent).toBe('line1')
|
||||
expect(queryByTestId('comment.1').textContent).toBe('line2')
|
||||
})
|
||||
|
||||
it.each([null, undefined])(
|
||||
'should render the emptyText when value is %s',
|
||||
(body) => {
|
||||
const { queryByText } = render(
|
||||
<MultiLineTextField
|
||||
record={{ id: 123, body }}
|
||||
emptyText="NA"
|
||||
source="body"
|
||||
/>
|
||||
)
|
||||
expect(queryByText('NA')).not.toBeNull()
|
||||
}
|
||||
)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue