mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-11 18:13:52 +02:00
unit test
This commit is contained in:
parent
5b1c53dffa
commit
ae44d6f2bf
@ -34,6 +34,23 @@ exports[`properties/dateRange handle clear 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`properties/dateRange returns component with new date after prop change 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="DateRange octo-propertyvalue"
|
||||
>
|
||||
<button
|
||||
class="Button"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
June 15
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`properties/dateRange returns default correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
|
@ -315,4 +315,36 @@ describe('properties/dateRange', () => {
|
||||
|
||||
expect(mockedMutator.changePropertyValue).toHaveBeenCalledWith(board.id, card, propertyTemplate.id, JSON.stringify({from: today}))
|
||||
})
|
||||
|
||||
test('returns component with new date after prop change', () => {
|
||||
const component = wrapIntl(
|
||||
<DateProp
|
||||
property={new DateProperty()}
|
||||
propertyValue=''
|
||||
showEmptyPlaceholder={false}
|
||||
readOnly={false}
|
||||
board={{...board}}
|
||||
card={{...card}}
|
||||
propertyTemplate={propertyTemplate}
|
||||
/>,
|
||||
)
|
||||
|
||||
const {container, rerender} = render(component)
|
||||
|
||||
rerender(
|
||||
wrapIntl(
|
||||
<DateProp
|
||||
property={new DateProperty()}
|
||||
propertyValue={'{"from": ' + June15.getTime().toString() + '}'}
|
||||
showEmptyPlaceholder={false}
|
||||
readOnly={false}
|
||||
board={{...board}}
|
||||
card={{...card}}
|
||||
propertyTemplate={propertyTemplate}
|
||||
/>
|
||||
)
|
||||
)
|
||||
|
||||
expect(container).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user