Skip to content

Commit

Permalink
Add failing React.memo test
Browse files Browse the repository at this point in the history
  • Loading branch information
billyjanitsch authored and novemberborn committed Jan 12, 2019
1 parent 7b7c032 commit 5e2b624
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/serialize-and-encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ useDeserializedRendered.title = prefix => `deserialized rendered ${prefix} is eq
const macros = [useDeserialized, useDeserializedRendered]

test('react elements', macros, () => <HelloMessage name='John' />)
// TODO: Combine next two tests with `macros` array
test.failing('memoized react elements', useDeserialized, () => {
const MemoizedHelloMessage = React.memo(HelloMessage)
return <MemoizedHelloMessage name='John' />
})
test('memoized react elements', useDeserializedRendered, () => {
const MemoizedHelloMessage = React.memo(HelloMessage)
return <MemoizedHelloMessage name='John' />
})
test('fragments', macros, () => <React.Fragment><HelloMessage name='John' /></React.Fragment>)
test('object properties', macros, () => {
return React.createElement('Foo', {object: {baz: 'thud'}})
Expand Down

0 comments on commit 5e2b624

Please sign in to comment.