Create unit test to json-pretty component.
Refactor json-pretty from view to component.