added unit test for viewer.